vertical line with current series y-values on mouse posiiton

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Arction_LasseP

Posts: 67
Joined: Mon Sep 28, 2015 1:14 pm

vertical line with current series y-values on mouse posiiton

Post by Igor » Wed Dec 06, 2017 8:22 am


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 (68.67 KiB) Viewed 2855 times
2017-12-06_0910.png (54.04 KiB) Viewed 2855 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


Posts: 386
Joined: Mon Mar 14, 2016 9:22 am

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

Post by ArctionKestutis » Thu Dec 07, 2017 7:22 am

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.