发布网友 发布时间:2022-05-29 19:43
共2个回答
热心网友 时间:2023-11-14 21:28
MSChart1.Plot.SeriesCollection(1).DataPoints(-1).DataPointLabel.LocationType = VtChLabelLocationTypeAbovePoint
Private Sub Command1_Click()
'显示图方法1
Dim Column As Integer
Dim Row As Integer
With MSChart1
.ColumnCount = 1
.RowCount = 10
For Column = 1 To .ColumnCount
For Row = 1 To .RowCount
.Column = Column
.Row = Row
.data = Round(Rnd * 100, 2)
.RowLabel = Row & "月"
.ColumnLabel = CStr(.data)
Next Row
Next Column
.Plot.SeriesCollection(1).DataPoints(-1).DataPointLabel.LocationType = VtChLabelLocationTypeAbovePoint
End With
End Sub
Private Sub Command2_Click()
' 显示图,方法2
Dim data(1 To 10, 1 To 3)
Dim i As Integer
For i = 1 To UBound(data)
data(i, 1) = i & "月" 'X轴标签
data(i, 2) = i * 10 '第一系列
data(i, 3) = i * 20 '第二系列
Next i
MSChart1.ChartData = data
MSChart1.Plot.SeriesCollection(1).DataPoints(-1).DataPointLabel.LocationType = VtChLabelLocationTypeAbovePoint
End Sub
热心网友 时间:2023-11-14 21:28
我没用过msChart