Again(Datetime in Addrealtime does not work)

TeeChart for ActiveX, COM and ASP
Post Reply
M.Takeda
Newbie
Newbie
Posts: 18
Joined: Tue Aug 17, 2004 4:00 am

Again(Datetime in Addrealtime does not work)

Post by M.Takeda » Wed Jan 18, 2006 11:03 am

Thank you for your prompt reaction.
But your suggestion does not solve my problem.
No.1 is your example and No2 is modified it.
No.1 program work fine but No.2 does not work correctly.

Please check again and teach me what is wrong. Thank you in advance.
'------------------------------- No1 --------------------------------------
Dim t As Integer

Private Sub Form_Load()
With TChart1
.AddSeries scFastLine

.TimerEnabled = True
.TimerInterval = 100
End With
End Sub

Private Sub TChart1_OnTimer()
t = t + 1
TChart1.Series(0).asFastLine.AddRealTime t, Cos(t), "", clTeeColor
End Sub

'------------------------------No2(fro example)--------------------------------
Dim t As Double
Private Sub Form_Load()
With TChart1
.AddSeries scFastLine
.Series(0).XValues.DateTime = True
.TimerEnabled = True
.TimerInterval = 1000
End With
t= CDbl(Now)
End Sub

Private Sub TChart1_OnTimer()
t = DateAdd("s", 1, t)
TChart1.Series(0).asFastLine.AddRealTime t, Cos(t), "", clTeeColor
End Sub

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Jan 20, 2006 4:37 pm

Hi,

if you want the exmple No.2 work in the same way as the example No.1 but showing datetime axis labels you should use the following code :

Code: Select all

'------------------------------No2(fro example)--------------------------------
Dim t As Double
Private Sub Form_Load()
With TChart1
.AddSeries scFastLine
.Series(0).XValues.DateTime = True
.TimerEnabled = True
.TimerInterval = 100
.Axis.Bottom.Labels.Angle = 90
.Axis.Bottom.Labels.DateTimeFormat = "hh:mm:ss"
End With
t = CDbl(Now)
End Sub

Private Sub TChart1_OnTimer()
t = DateAdd("d", 1, t)
TChart1.Series(0).asFastLine.AddRealTime t, Cos(t), "", clTeeColor
End Sub

Post Reply