Live data draws back in time when zoomed in
Posted: Mon May 13, 2013 4:55 pm
Hello,
I'm finding that while I'm plotting live, changing data, if I zoom in on a specific area, the incoming data plots far to the left of the current time. Below is my basic setup.
It acts as if when the plot is zoomed that the incoming data is plotted with the ExpectedJobLength variable temporarily changed to the zoomed Time length. Example if I start out at 120 mins., ExpectedJobLength = 120. After I zoom in and display 5 min., then ExpectedJobLength seems to be getting changed to 5 mins. So any new incoming data is plotted further to the left once the plot is un-zoomed.
ExpectedJobLength is not actually changing, but it does seem to act like it.
ExpectedJobLength is in minutes.
The Series is Line.
Any ideas?
Thanks
I'm finding that while I'm plotting live, changing data, if I zoom in on a specific area, the incoming data plots far to the left of the current time. Below is my basic setup.
It acts as if when the plot is zoomed that the incoming data is plotted with the ExpectedJobLength variable temporarily changed to the zoomed Time length. Example if I start out at 120 mins., ExpectedJobLength = 120. After I zoom in and display 5 min., then ExpectedJobLength seems to be getting changed to 5 mins. So any new incoming data is plotted further to the left once the plot is un-zoomed.
ExpectedJobLength is not actually changing, but it does seem to act like it.
ExpectedJobLength is in minutes.
The Series is Line.
Code: Select all
'SETUP CODE:
With Tchart1.axis
.Bottom.Maximum = TimeValue(Format$(TimeSerial(0, ExpectedJobLength, 0), "hh:mm"))
.Bottom.Labels.DateTimeFormat = "h:mm"
.Bottom.MinorTickCount = 4
.Bottom.Labels.Style = talValue
.Bottom.Maximum = TimeValue(Format$(TimeSerial(0, JobInfo.ExpectedJobLength, 0), "hh:mm"))
.Bottom.Increment = TimeValue("00:00:01")
.Bottom.Increment = TChart1.GetDateTimeStep(dtOneSecond)
End With
Code: Select all
'Timer routine - TChart1.OnTimer:
bb = ExpectedJobLength * 60
For aa = 0 To 7
With TChart1.Series(aa)
Chart_X = .count * (TChart1.axis.Bottom.Maximum / bb)
Chart_Y(aa) = Data2Plot(aa).YData
.AddXY Chart_X, Chart_Y(aa), "", Data2Plot(aa).TraceColor
End With
Next aa
Thanks