Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Scatter graph : Get XYcursor label value

Solved!
Go to solution

 

Using Measurement Studio 2013 with Visual Studio Professional 2012,

 

On a scatter graph, is it possible to get the actual label value of a xycursor?

 

For example, my label displays a date-time format on X axis so it looks like : [ 4:35:49 ; 0,27101 ]

 

It it possible to get this value? If for example I want to display it in a TextBox?

I am able to get the xycursor.Xposition and xycursorYposition but not what I want.

 

Thanks for any help! Cat Happy

 

0 Kudos
Message 1 of 2
(5,625 Views)
Solution
Accepted by topic author LYN_007

Here's a solution to my question :

 

{

// Get xy cursor index of point in plot
int index = xyCursor1.GetCurrentIndex();

 

// Get values at that point (in plot)
double x;
double y;
scatterGraph.Plots[0].GetDataPoint(index, out x, out y);

 

// X value to DateTime format & convert to Time format
DateTime t = (DateTime)NationalInstruments.DataConverter.Convert(x, typeof(DateTime));

string time = t.ToString("hh:mm:ss");

}

 

It is also possible to get Xposition for xycursor and to convert it in the same way.

0 Kudos
Message 2 of 2
(5,581 Views)