vb控件mschart 显示 柱状图显示时如何显示 每个柱状图的当前数量
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