Home > Software engineering >  Pray god to help take a look at this period of VB Tchart program what's the problem
Pray god to help take a look at this period of VB Tchart program what's the problem

Time:09-20

 Dim temp As Integer 'horizontal axis length 
Dim STime As the Variant 'real time
Dim shuju_shishi As Integer
Dim shuju_zuidi As Integer
Dim shuju_guonei As Integer
Dim shuju_guoji As Integer
Dim shuju (3) As an Integer
Dim n As an Integer, I, As an Integer, j As an Integer, k As Integer
Private Sub Form_Load ()

STime=Now
Temp=300

Shuju_shishi=700 + 100 * Rnd () 'data assignment (not numerical simulation, field data)
Shuju_zuidi=650
Shuju_guonei=700
Shuju_guoji=400

Shuju (0)=shuju_shishi 'assigned to data array
Shuju (1)=shuju_zuidi
Shuju (2)=shuju_guonei
Shuju (3)=shuju_guoji

Text1.=shuju_shishi 'Text Text display real-time data
Text2. Text=shuju_zuidi
Text3. Text=shuju_guonei
Text4. Text=shuju_guoji

For I=0 To 3
With TChart1. Series (I)
. XValues. DateTime=True
End With
Next I

With TChart1. Axis. Bottom
. Labels. DateTimeFormat="yy - mm - dd HH: mm: ss" '
date type of formatThe Automatic=False
Maximum=DateAdd (" s ", temp, Now)
The Minimum=Now
End With

For k=0 To 3 'drawing
With TChart1. Series (k)
. AddXY Now shuju (k), "", clTeeColor
End With
Next k

End Sub

Private Sub Timer1_Timer ()
Shuju_shishi=700 + 100 * Rnd () 'data assignment (not numerical simulation, field data)
Shuju_zuidi=650
Shuju_guonei=700
Shuju_guoji=400

Shuju (0)=shuju_shishi 'assigned to data array
Shuju (1)=shuju_zuidi
Shuju (2)=shuju_guonei
Shuju (3)=shuju_guoji

Text1.=shuju_shishi 'Text Text display real-time data
Text2. Text=shuju_zuidi
Text3. Text=shuju_guonei
Text4. Text=shuju_guoji

If n=0 Then
With TChart1. Axis. Bottom
. Labels. DateTimeFormat="yy - mm - dd HH: mm: ss" '
date type of formatThe Automatic=False
Maximum=DateAdd (" s ", temp, STime)
The Minimum=STime
End With
End the If
N=n + 1
If n & gt; (temp/Timer1. Interval/(1000)) Then 'when more than controls the display of the time, to change the page
STime=Now
With TChart1. Axis. Bottom
The Automatic=False
The Maximum=STime
Minimum=DateAdd (" s "- temp, STime)
End With
N=temp to prevent n + 1 'exceeds the maximum limit integer can say
End the If

For k=0 To 3 'drawing
With TChart1. Series (k)
. AddXY Now shuju (k), "", clTeeColor
End With
Next k

End Sub



Run time always said not found method or data members
Mark the Series (I) the place

CodePudding user response:

TChart1. Series

TChart1 behind the ". "and see if the list has the option of a Series, if the Series is your own input, then should not this member or method

CodePudding user response:

All commented On the Error Resume Next statement, in VB6 IDE,
The error and then click the debugging, the cursor will stop error in the statement,
Or
In doubt may have a logical error statements in advance to set breakpoints, run through the breakpoint interrupt,

At this point can be used in the immediate window
? The variable name
Or
? The function name () function parameter
Or
Process (parameters)
Auxiliary debugging,

CodePudding user response:

reference 1/f, worldy response:
TChart1. Series

TChart1 behind the ". "and see if the list has the option of a Series, if the Series is your own input, then should not this member or method

Can you give us detailed explain
  • Related