VB使用TEECHART工具绘制实时曲线怎么实现?
若横坐标是点的话,比较好实现,用MAX,MIN 属性就能做出,如下:Private Sub Timer1_Timer()
Dim a As Integer
b = b + 1
k = Rnd(100)
TChart1.Series(0).Add k, b, vbBlue
With TChart1
.Scroll.Enable = pmHorizontal 'permit manual scrolling horizontally only.
.Axis.Bottom.Automatic = False
.Axis.Bottom.Maximum = b
If b < 10 Then
.Axis.Bottom.Minimum = 0
Else
.Axis.Bottom.Minimum = b - 10
End If
.Repaint
End With
End Sub
横坐标是时间,怎么实现?
看过dephi里面有一种方法:
if series1.count>100 then
charttool1.axis.scroll(1.0,true)
就能移动横坐标
关键是在VB里面这个属性和方法怎么实现啊?