VB:mschart画条形图X轴显示数据问题
我想把msflexgrid中2列N>1000行数据用mschart画条形图,要求:第一列作为x轴,第二列作为y轴,也就是对应的1,2列分别为(x,y)坐标,并把x,y轴分别显示数据,而不是x轴显示C1,c2,,,,,,这一点非常难做,请高手帮吗?我就是想把X数据下面显示数据! --------------------编程问答-------------------- If MSFlexGridData.Rows = 2 Then
MsgBox "未输入数据,无剖面特征可显示!", vbOKOnly, "提示"
Else
DiaCSD.Visible = False
On Error Resume Next
With DiaCSD.MSChart1
.AllowDithering = True
.AllowDynamicRotation = True
.AllowSelections = True
.AllowSeriesSelection = True
.AutoIncrement = True
.ShowLegend = True
' .Plot.Axis(VtChAxisIdY).ValueScale.Auto = False
' .Plot.Axis(VtChAxisIdY2).ValueScale.Auto = False
' .Plot.Axis(VtChAxisIdY).ValueScale.Minimum = 0
' .Plot.Axis(VtChAxisIdY).ValueScale.Maximum = 5
' .Plot.Axis(VtChAxisIdY2).ValueScale.Minimum = 0
' .Plot.Axis(VtChAxisIdY2).ValueScale.Maximum = 5
.Plot.Axis(VtChAxisIdX).ValueScale.MajorDivision = 5 'X轴主要网格数量
.Plot.Axis(VtChAxisIdY).ValueScale.MajorDivision = 5 'Y轴主要网格数量
.Plot.Axis(VtChAxisIdX).ValueScale.MinorDivision = 0 'X轴次要网格数量
.Plot.Axis(VtChAxisIdY).ValueScale.MinorDivision = 0 'Y轴次要网格数量
.Plot.Axis(VtChAxisIdX).AxisGrid.MajorPen.Style = VtPenStyleDotted
.Plot.Axis(VtChAxisIdY).AxisGrid.MajorPen.Style = VtPenStyleDotted
.Plot.AutoLayout = False
.Plot.UniformAxis = False
.ChartType = VtChChartType2dBar 'VtChChartType2dXY '设置图形为二维散点图
.TitleText = "水易做图吸汽剖面解释"
.Plot.Axis(VtChAxisIdX, 0).AxisTitle = "测 深 (m)"
.Plot.Axis(VtChAxisIdY, 0).AxisTitle = "吸汽百分数"
.Legend.Location.LocationType = VtChLocationTypeBottomRight
End With
With MSFlexGridData
ReDim MyData(1 To .Rows - 1, 0 To 1)
Dim i As Integer
For i = 1 To .Rows - 1
MyData(i, 0) = Str(MSFlexGridData.TextMatrix(i, 0))
MyData(i, 1) = Val(MSFlexGridData.TextMatrix(i, 1))
Next i
End With
DiaCSD.MSChart1.ChartData = MyData
DiaCSD.MSChart1.Plot.SeriesCollection(1).LegendText = "吸汽百分数"
DiaCSD.Show
End If --------------------编程问答-------------------- N>1000行,就算横1000,竖1000,再说小些横100,竖100都难画开.
补充:VB , 控件