Drag PointLineSeries
Moderator: Queue Moderators
Drag PointLineSeries
Is it possible to drag a pointLineSeries with mouse on the X axis to apply an offset to the points?
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Drag PointLineSeries
Not directly, but via event handlers...
In series.MouseDown or equivalent event handler you can get the original y axis value by using
YAxis.CoordToValue to y1.
In chart.MouseUp event handler, you can get the Y coordinate with the same method as y2.
Now you now the yDelta = (y2 - y1). Loop through the data points of the series, and add that yDelta to each point Y value. Then call series.InvalidateData().
That should work.
In series.MouseDown or equivalent event handler you can get the original y axis value by using
YAxis.CoordToValue to y1.
In chart.MouseUp event handler, you can get the Y coordinate with the same method as y2.
Now you now the yDelta = (y2 - y1). Loop through the data points of the series, and add that yDelta to each point Y value. Then call series.InvalidateData().
That should work.
LightningChart Support Team, PT
Re: Drag PointLineSeries
The problem is that my PointLineSeries have millions of points. Apply the offset for each point is too expensive.
Is there a way to apply an offset to the entire series? (the mouse interaction is not fundamental)
Is there a way to apply an offset to the entire series? (the mouse interaction is not fundamental)
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Drag PointLineSeries
Can you use SampleDataSeries? There' AddOffsetToSamples method.
Alternatively, adjust the Y axis range and manipulate with the labels. For example, using CustomTicks.
Alternatively, adjust the Y axis range and manipulate with the labels. For example, using CustomTicks.
LightningChart Support Team, PT