Live data draws back in time when zoomed in

TeeChart for ActiveX, COM and ASP
Post Reply
tirby
Newbie
Newbie
Posts: 84
Joined: Mon Mar 16, 2009 12:00 am

Live data draws back in time when zoomed in

Post by tirby » 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.

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

Any ideas?

Thanks

tirby
Newbie
Newbie
Posts: 84
Joined: Mon Mar 16, 2009 12:00 am

Re: Live data draws back in time when zoomed in

Post by tirby » Mon May 13, 2013 7:42 pm

I've noticed that it also tends to draw the trace well advanced to to the right (beyond the bounds of the right side drawing area) after un-zooming. The live data seems to plot in the right place, but looks like its interupting the drawn line.
I will post some screen shots.

<Edited>

I could not make the traces do as I stated, however, the realtime data is plotting in the middle of the zoomed view rather than at the rightmost end of the trace line. The document I posted after this give examples.
Last edited by tirby on Mon May 13, 2013 8:22 pm, edited 1 time in total.

tirby
Newbie
Newbie
Posts: 84
Joined: Mon Mar 16, 2009 12:00 am

Re: Live data draws back in time when zoomed in

Post by tirby » Mon May 13, 2013 8:19 pm

See attached MS Word files.
Attachments
Graphs.Zip
MSWord 2003 & 2007 formats
(228.7 KiB) Downloaded 897 times

Yeray
Site Admin
Site Admin
Posts: 9587
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Live data draws back in time when zoomed in

Post by Yeray » Wed May 15, 2013 8:33 am

Hello,

In the Timer routine you are calculating the XValue to add like this:

Code: Select all

Chart_X = .count * (TChart1.axis.Bottom.Maximum / bb)
So this value has a relation with the bottom axis maximum, that changes when you zoom or scroll. You should not use this bottom axis value to calculate the next XValue.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

tirby
Newbie
Newbie
Posts: 84
Joined: Mon Mar 16, 2009 12:00 am

Re: Live data draws back in time when zoomed in

Post by tirby » Wed May 15, 2013 2:35 pm

Thanks Yeray!
Sometimes you just can't see the forest cause the trees are blocking your view!

Yeray
Site Admin
Site Admin
Posts: 9587
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Live data draws back in time when zoomed in

Post by Yeray » Thu May 16, 2013 7:12 am

hehe, you're welcome! :)
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply