Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

graph two lines and difference between two points

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

graph_cursor11.png

this is my graph. I want to draw this two lines. The two lines should be movable.

graph_cursor1.png

 

Now i need some Possibilitys to calculate the max Values and the difference from it.

Thanks

0 Kudos
Message 1 of 2
(5,335 Views)

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.

~ Paul H
0 Kudos
Message 2 of 2
(5,325 Views)