VB中怎么使用mschart控件
哪位大哥给点代码看看,案例也行,ren51me@163.com这我邮箱
我想作的是彩票走势图那种格式的
[解决办法]
Private Sub Command1_Click()
Dim iCol As Integer
Dim iRow As Integer
Dim i As Integer
With MSChart1
'// 以线条方式显示
.chartType = VtChChartType2dBar
'// 把刻录改为手工方式
'.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 = 4
.RowCount = 5
For iCol = 1 To .ColumnCount
For iRow = 1 To .RowCount
.Column = iCol
.Row = iRow
.Data = iCol * iRow
Next
Next
.Column = 3
.Row = 3
.Data = 112
'// 将图表作为图例的背景。
.ShowLegend = True
'// 标记每个点的值
For i = 1 To .Plot.SeriesCollection.Count
.Plot.SeriesCollection(i).DataPoints(-1).DataPointLabel.LocationType = VtChLabelLocationTypeAbovePoint
Next
End With
End Sub