ViewXY w\ SampleLineSeries, mouse-over 'track point'

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

ViewXY w\ SampleLineSeries, mouse-over 'track point'

Post by greggorob64 » Thu Apr 09, 2015 12:57 pm

I have several samplelineseries (line only, no points) with several million points on the chart.

I'd like to show any kind of indicator when my mouse goes over a trace point (or nearest point, i'm not very picky there). Here is how our old graphing package looked:

Image

I know in the example application its sets points=true (or in some cases puts annotations on every single point). Both of those will cause memory usage to spike and immediately get an OutOfMemoryException.

I think the best bet is to handle the mouse-over event, and manually put something there at that point. Maybe an annotation, which is just a dot or something? What do you recommend?

Thanks!

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

Re: ViewXY w\ SampleLineSeries, mouse-over 'track point'

Post by ArctionPasi » Thu Apr 09, 2015 5:12 pm

SampleDataSeries has SolveNearestSampleByCoord method. In chart.MouseMove event handler, use that, and place a SeriesEventMarker or Annotation on the location of the solved point.

This is one approach :)
LightningChart Support Team, PT

greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

Re: ViewXY w\ SampleLineSeries, mouse-over 'track point'

Post by greggorob64 » Mon Apr 13, 2015 12:50 pm

Thanks, I'll give the series event markers a try today

greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

Re: ViewXY w\ SampleLineSeries, mouse-over 'track point'

Post by greggorob64 » Wed Apr 15, 2015 3:33 pm

This method works very well, but I have a followup.

I have code in my mousemove, and foreach series (3 series, for example), I find the closest point to my cursor, and plop an event marker there.

I would liek to know the X\Y coordinate of the point that I found. I only want to show an event marker if there is one found within some distance (20px) of the mouse cursor.;


Is there a way to convert an X\Y value or samplenumber to XY screen coordinates?

Thanks!

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

Re: ViewXY w\ SampleLineSeries, mouse-over 'track point'

Post by ArctionPasi » Wed Apr 15, 2015 6:35 pm

You can do that with xAxis.ValueToCoord and yAxis.ValueToCoord method.
LightningChart Support Team, PT

Post Reply