4,820
社区成员
发帖
与我相关
我的任务
分享
Private Sub Command1_Click()
Dim iCol As Integer
Dim iRow As Integer
Dim i As Integer
With MSChart1
'// 以线条方式显示
.ChartType = VtChChartType2dLine
'// 把刻录改为手工方式
.Plot.Axis(VtChAxisIdY).ValueScale.Auto = False
'// 设置最大值
.Plot.Axis(VtChAxisIdY).ValueScale.Maximum = 700
'// 设置最小值
.Plot.Axis(VtChAxisIdY).ValueScale.Minimum = 0
'// 设置每格为 50
.Plot.Axis(VtChAxisIdY).ValueScale.MinorDivision = 50
'// 增加测试数据
.columnCount = 3
.rowCount = 3
For iCol = 1 To .columnCount
For iRow = 1 To .rowCount
.Column = iCol
.Row = iRow
.Data = iRow * 10
Next
Next
'// 将图表作为图例的背景。
.ShowLegend = True
'// 标记每个点的值
For i = 1 To .Plot.SeriesCollection.Count
.Plot.SeriesCollection(i).DataPoints(-1).DataPointLabel.LocationType = VtChLabelLocationTypeAbovePoint
Next
End With
End Sub