I have a view XY chart, with 1 cursor (snap to points=true). My X axis values are increasing monotonically (0,1,2...). I'd like to be able to enter a value, "set my cursor to X = 50000".
However, if the user enters 50000.123, i'd like it snap to [either nearest, or before/after] point. Can this be done?
ViewXY: Cursor with SnapToPoints=true, setting X Value
Moderator: Queue Moderators
-
- Posts: 183
- Joined: Tue Mar 18, 2014 2:55 pm
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: ViewXY: Cursor with SnapToPoints=true, setting X Value
The cursor in fact snaps to nearest point if you set lineSeriesCursor.ValueAtXAxis = 50000.123. The property value stays 50000.123, but the line renders in the position of 50000.
You can of course round the value in app side:
lineSeriesCursor.ValueAtXAxis = Math.Round(50000.123);
You can of course round the value in app side:
lineSeriesCursor.ValueAtXAxis = Math.Round(50000.123);
LightningChart Support Team, PT
-
- Posts: 183
- Joined: Tue Mar 18, 2014 2:55 pm
Re: ViewXY: Cursor with SnapToPoints=true, setting X Value
Thanks for the reply. I'll have to do it manually. In this example, it starts at zero and increasing monotonically, but i'll have other examples that could have any [delta] and [offset]. I'll need to make a method to manually resolve an x coordinate.