Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

get data points in the plot and compute the slope between this two points

Hi,
 
i need this kind of function, I have a plot, and the user can use mouse to choose any two point in this historical plot data. after the choose two point, the function can calculate the slope between this two point, any body knows, how to get point in the graphics? thx
0 Kudos
Message 1 of 4
(3,273 Views)
Hi YHong,

It sounds like you need to first convert the client coordinates over to plot coordinates.  We added the functions,
InverseMapDataPoint and InverseMapDataPoints functions to XYPlot in Measurement Studio 8.0.1 to help you do this conversion. Check out this post and this post for code snippets.

Once you get those coordinates, its very simple to calculate the slope.

See if this helps!

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 2 of 4
(3,267 Views)

Hi, Jonathan N

Thank you for your reply. What your answer is a kind of what I asked, but precisely, I need to pick the point in the history records, which means, in the graphics, there are more than two plots, i would like to pick point in the plots, then calculate slope between two points.

 

thanks

0 Kudos
Message 3 of 4
(3,248 Views)

Hi YHong,

I don't quite understand your statement "I need to pick the point in the history records", which means, in the graphics". Wherever you click on the graph, you will get screen coordinates and then you use those functions I mentioned to convert over to plot coordinates. 

So the user will just be clicking random points on the plot correct? Do you then want to know if the user happened to click on a coordinate that maps directly to a plot data point? How will you determine how "close" user has to click to the "actual" data coordinates to validate it should be associate with plot data? Then do you want to determine which plot that the coordinates respond to?

I'm going to need to some clarification on your end goals here.

Thanks

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 4 of 4
(3,245 Views)