Page 1 of 1

vertical line with current series y-values on mouse posiiton

Posted: Wed Dec 06, 2017 8:22 am
by Igor
Hi,

my current task is to replace the chart control in our application with the LightingChart, because of performance reasons.
By the implementation of a function, I would need a piece of advice from you.

If the mouse cursor is in the view, a vertical line should appear. The line position should be equivalent to the mouse cursor position.
The nearest series points (refered to the x-axis) should be displayed in a box near to the vertical line.
When the mouse cursor leaves the view the line should disappear.
2017-12-06_0911.png
2017-12-06_0911.png (68.67 KiB) Viewed 4904 times
2017-12-06_0910.png
2017-12-06_0910.png (54.04 KiB) Viewed 4904 times
My first thought was to use a LineSeriesCursor and set the LineSeriesCursor position manually to the current mouse cursor position. For the box I would use an annotation.
To hide the line and the info-box I would use the MouseLeave-event from the lightingchart itself, but I dont know if I can rely on this event. Will it be triggered reliable?

Do you have an another advice for a simpler solution?

thank you very much

Igor

Re: vertical line with current series y-values on mouse posi

Posted: Thu Dec 07, 2017 7:22 am
by ArctionKestutis
Hi Igor,

There are several ways to track mouse on LightningChart. It depends on type of series used and visual considerations.
There is group of examples in our Demo App, under XY -> CursorTracking. The basic idea is to combine Mouse-move, Mouse-over event and Annotation or similar object. However, for tracking several series at the same time we have dedicate tool/object. That is Line series cursors, which allows visual analysis of line series data by tracking the values by X coordinate. Series values are can only be resolved with series implementing ITrackable interface (SampleDataSeries, PointLineSeries, AreaSeries, HighLowSeries). More about Cursor in User’s Manual chapter 'Line series cursors'.
Please check those examples, and let us know if something is still missing.

All the best.