回复 6楼 lianyicq
Dim mydata(600, 1)
Dim i As Single
Private Sub Form_Load()
With MSChart1
.TitleText = "压强变化 kpa/s"
'
'设置图线的外观
.Plot.SeriesCollection(1).Pen.Width = 30
.Plot.SeriesCollection(1).Pen.Style = VtPenStyleSolid
.Plot.SeriesCollection(2).Pen.Width = 30
.Plot.SeriesCollection(2).Pen.Style = VtPenStyleSolid
.Plot.SeriesCollection(3).Pen.Width = 30
.Plot.SeriesCollection(3).Pen.Style = VtPenStyleSolid
'
'设置XY轴
.Plot.Axis(VtChAxisIdX).ValueScale.Auto = False
.Plot.Axis(VtChAxisIdY).ValueScale.Auto = False
'// 设置最大值
.Plot.Axis(VtChAxisIdX).ValueScale.Maximum = 600 '设置横轴标注最大值
.Plot.Axis(VtChAxisIdY).ValueScale.Maximum = 1000 '设置纵轴标注最大值
'// 设置最小值
.Plot.Axis(VtChAxisIdY).ValueScale.Minimum = 400
.Plot.Axis(VtChAxisIdX).ValueScale.Minimum = 0
.Plot.Axis(VtChAxisIdX).ValueScale.MajorDivision = 6 'X轴主要网格数量
.Plot.Axis(VtChAxisIdY).ValueScale.MajorDivision = 6 'Y轴主要网格数量
.Plot.Axis(VtChAxisIdX).ValueScale.MinorDivision = 0 'X轴次要网格数量
.Plot.Axis(VtChAxisIdY).ValueScale.MinorDivision = 0 'Y轴次要网格数量
.Plot.Axis(VtChAxisIdX).AxisGrid.MajorPen.Style = VtPenStyleDotted
.Plot.Axis(VtChAxisIdY).AxisGrid.MajorPen.Style = VtPenStyleDotted
' .Plot.Axis(VtChAxisIdY).AxisTitle = "压强(kpa)"
.Plot.Axis(VtChAxisIdX).AxisTitle = "时间(s)"
MSChart1.Plot.AutoLayout = False
MSChart1.Plot.UniformAxis = False
MSChart1.chartType = VtChChartType2dXY '设置图形为二维散点图
'
MSChart1.ChartData = mydata
'MSChart1.Backdrop.Fill.Style = VtFillStyleBrush
'MSChart1.Backdrop.Fill.Brush.FillColor.Set 0, 0, 0
'
For i = 1 To 600
''
.Row = i
'
.RowLabel = i
'
Next
End With
End Sub
Private Sub Timer1_Timer()
mydata(i, 0) = i
mydata(i, 1) = 700
MSChart1.ChartData = mydata
i = i + 1
If i > 600 Then
Timer1.Enabled = False
Else
Timer1.Enabled = True
End If
End Sub
图片附件: 游客没有浏览图片的权限,请
登录 或
注册
图片附件: 游客没有浏览图片的权限,请
登录 或
注册
这是我做的程序 只能动态显示一条曲线
显示多条 怎能定义数组 和 给mschart控件赋值