Draw area on single y axis

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
vifani
Posts: 49
Joined: Thu May 02, 2013 8:35 am

Draw area on single y axis

Post by vifani » Tue Dec 02, 2014 3:32 pm

I want to allow area drawing on the chart, but limited on one y axis.
I use a polygon series to draw the rectangle:
screenshot.png
screenshot.png (99.11 KiB) Viewed 4474 times
How can I clip the rectangle in the selected y axis?

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Draw area on single y axis

Post by ArctionPasi » Thu Dec 04, 2014 2:44 pm

In MouseDown event, you can use ViewXY.GetGraphSegmentInfo method. That will report the info needed to get each Y axis segment's vertical position in screen pixels. Use those pixel coordinates as a limit. You can use yAxis.CoordToValue method to convert the limit coordinate into a limit Y axis value and limit the polygon's point based on that.
LightningChart Support Team, PT

Post Reply