Drag PointLineSeries

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
vifani
Posts: 49
Joined: Thu May 02, 2013 8:35 am

Drag PointLineSeries

Post by vifani » Mon Jan 26, 2015 8:39 am

Is it possible to drag a pointLineSeries with mouse on the X axis to apply an offset to the points?

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Drag PointLineSeries

Post by ArctionPasi » Mon Jan 26, 2015 11:35 pm

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. :?
LightningChart Support Team, PT

vifani
Posts: 49
Joined: Thu May 02, 2013 8:35 am

Re: Drag PointLineSeries

Post by vifani » Tue Jan 27, 2015 11:11 am

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)

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Drag PointLineSeries

Post by ArctionPasi » Tue Jan 27, 2015 11:23 am

Can you use SampleDataSeries? There' AddOffsetToSamples method.

Alternatively, adjust the Y axis range and manipulate with the labels. For example, using CustomTicks.
LightningChart Support Team, PT

Post Reply