09-09-2012 10:02 AM
Hello,
I have to make an overlay graph having multiple Y axes attributes with a single X axis "Time" attribute. Can you please guide me is it possible to achieve in C# .Net using NI Measurement Studio. A sample code would be greatly appreciated.
Regards,
Naureen.
09-10-2012 10:28 AM
Hi Naureen,
Take a look at this NI commnuity example. It shows how you can have multiple y-axes and a single x-axis on a waveform graph.
Hope this helps.
09-12-2012 02:07 PM
Hi,
Thanks for your help. Why the graph does not zoom (in/out) when I zoom it in the sample code. Same is the case with panning.
Regards,
Naureen.
09-12-2012 03:18 PM
Hi Naureen,
What do you mean you by can't zoom or pan? Are you having trouble doing this programatically? If you are trying to zoom and pan programatically, take a look at this example.
09-13-2012 01:09 AM
Hello,
Actually what I mean is that, by doing zooming or panning with the mouse I do not see the effects of these operations. I am not doing it programmatically, assuming that the default properties of the waveform graph should work.
Regards,
Naureen.
09-13-2012 10:49 AM
Zooming and panning functionality is available using a mouse or keyboard. Take a look at this help document for more information about zooming and this help document for panning.
What you will need to do is first make sure the InteractiveMode property for the graph is set correctly. Once that is set, you can hold the <Shift> key or the <Ctrl> key to zoom or pan the graph using the mouse, respectively. Details on what to set the InteractiveMode property to and how to use a mouse to zoom and pan are in the documents I linked above.
11-14-2012 09:44 AM
Hi,
Nice example. I have implemented this by plotting multiple Y axis along single X axis(Time). When I plot my data, I get the graph but the problem is the X axis does not make any effect i.e: the time array that I provide, it does not plot rather the X axis starts from zero always. Also when I dont give the data for X axis the graph still renders the same.
Like if I have
YData1 = {2,5,7,8,9}
YData2 = {22,45,67,77.83}
XData = {10,20,30,40,50}
When I plot the above data YData1 and YData2 renders correctly but the XData does not. And when I place the cursor on a first point I get (0,2) instead of (10,2) on the YData1 plot.
Please tell me why the X-Axis does not render according to the data provided. Its the time data.
Regards,
Naureen
11-14-2012 01:15 PM
Hello there,
Change label format on xaxis:
//xAxis1.MajorDivisions.LabelFormat
xAxis1.MajorDivisions.LabelFormat = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.DateTime, "g");
Scaling the data value:
Controlling the label values on an XAxis (YAxis is also similar):
Regards,
Vijet Patankar
National Instruments