工程——部件——勾选Microsoft Chart Control 6.0(OLEBD)
Private Sub Form_Load()
Randomize Timer
Dim i As Integer, jls As Integer
Dim Values(1 To 15, 1 To 3)
For i = 1 To 15
Values(i, 1) = "T" & Format(i, "00")
Next i
For i = 1 To 15
Values(i, 2) = Rnd * 100 '以下两个赋相同的值就行了。
Values(i, 3) = Rnd(0) * 100
Next i
MSChart1.chartType = VtChChartType2dCombination
MSChart1.Plot.SeriesCollection.Item(1).SeriesType = VtChSeriesType2dLine
MSChart1.Plot.SeriesCollection.Item(2).SeriesType = VtChSeriesType2dBar
MSChart1.ChartData = Values
End Sub