12-10-2009 12:00 AM
I want to use the Scatter Graph to plot meter readings vs time. The time is the recent time obtained from the real time clock of the PC. I have set the XAxes[0].MajorDivisions.LabelFormat to Time in the property page but cannot show the actual time in x-axes (always shows 12:00 somewhat). Can any one advise me how to do it? Thanks.
YC
12-10-2009 10:09 AM
Hey YC -
When you call PlotXY(Append), the xData parameter determines the time that shows up on the X-Axis. If you begin at 0, you will begin at time 0 of the DateTime class - 12:00:00 midnight, January 1, 0001. Perhaps the easiest way to get the current date and time is to use the NationalInstruments.DataConverter class to get the current date time. It could look something like this:
Let me know if you have any questions.
NickB
National Instruments
12-10-2009 09:11 PM
Dear NickB,
Thank you for your advise. Maybe I am using VB, in order to make it works, I need to modify the statement as follows:
ScatterGraph1.PlotXYAppend(DataConverter.Convert(DateTime.Now, GetType(Double)), data)
YC