03-11-2016 06:38 PM
I'm trying to have the current time be shown on the x axis on the waveform graph but it always start from 12 am and counts normally after that.
How do I get it to start from the current time at this moment.
private void timer1_Tick(object sender, EventArgs e) { gauge2.Value = Convert.ToInt32(rxString); waveformGraph1.XAxes[0].MajorDivisions.LabelFormat = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.DateTime, "hh:mm:ss tt"); waveformGraph1.PlotYAppend(Convert.ToInt32(rxString)); }
Solved! Go to Solution.
03-12-2016 11:42 AM
I also added this code before the append and still nothing.
waveformPlot1.DefaultWaveformPlotOptions = new AnalogWaveformPlotOptions(AnalogWaveformPlotDisplayMode.Time, AnalogWaveformPlotScaleMode.Raw); waveformPlot1.DefaultTiming = WaveformTiming.CreateWithRegularInterval(TimeSpan.FromSeconds(1), DateTime.Now); waveformGraph1.XAxes[0].MajorDivisions.LabelFormat = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.DateTime, "hh:mm:ss tt");
03-12-2016 11:57 AM
looks like i figured it out .
just added this
this.waveformPlot1.DefaultStart = (double)DataConverter.Convert(DateTime.Now, typeof(double));