I'm working on moving our applications to the LightningChart and am hoping to preserve some existing behavior. When the user clicks anywhere on the chart, I want the appropriate Line Series Cursor to move to that location. The problem I'm having is trying to get interpolation to work with this.
As I'm handling a mouse click event, I only have X and Y coords. The Point Line Series class has methods for going from coords to nearest data points, but as far as I can tell they won't ever give an interpolated X-value. My goal is to somehow get an interpolated X-value from mouse coordinates so I can set the cursor.ValueAtXAxis property. Then get the corresponding interpolated Y values using series.SolveYValueAtXValue method. Is there any simple way to go about this? Is there another way I can move the cursor to the correct spot that I'm overlooking?
Place Line Cursor using a mouse click
Moderator: Queue Moderators
-
- Posts: 557
- Joined: Mon Mar 14, 2016 9:22 am
Re: Place Line Cursor using a mouse click
Hi,
There are various cursor tracking strategies illustrated in group of examples from our DemoApp -> XY -> 'CursorTracking'.
I believe that most suitable for you is
Please not that input argument is screen coordinates (not DIP units).
All the best.
There are various cursor tracking strategies illustrated in group of examples from our DemoApp -> XY -> 'CursorTracking'.
I believe that most suitable for you is
Code: Select all
Series.SolveNearestDataPointByCoord()
All the best.