Page 1 of 1

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

Posted: Thu Apr 09, 2015 12:57 pm
by greggorob64
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!

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

Posted: Thu Apr 09, 2015 5:12 pm
by ArctionPasi
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 :)

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

Posted: Mon Apr 13, 2015 12:50 pm
by greggorob64
Thanks, I'll give the series event markers a try today

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

Posted: Wed Apr 15, 2015 3:33 pm
by greggorob64
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!

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

Posted: Wed Apr 15, 2015 6:35 pm
by ArctionPasi
You can do that with xAxis.ValueToCoord and yAxis.ValueToCoord method.