03-03-2014 03:40 PM
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! ![]()
Solved! Go to Solution.
03-04-2014 02:02 PM
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.