05-27-2014 06:25 AM
Hello,
i want to add vertical or horizontal Lines per Mouseclick to my GRaph. This Lines can be moved to some points.
No i want to calculate the difference of this two point. For Example the intervall from two peaks.
Do you know what i mean ?
for example
this is my graph. I want to draw this two lines. The two lines should be movable.
Now i need some Possibilitys to calculate the max Values and the difference from it.
Thanks
05-27-2014 11:35 AM
I would recommend using a RangeCursor. You can use the ActualHorizontalRange property (which will have the same type as your horizontal axis). For example, in the handler for the PositionChanged event, you could calculate the interval as:
var range = (Range<double>)rangeCursor.ActualHorizontalRange;
double interval = range.Maximum - range.Minimum;
There are also helper methods, like RetrieveValues, to get the data values covered by the cursor.