MSChart控件不显示轴标题
为什么我的MSChart控件不显示2个轴的标题及日期数据呢?代码如下,求大家解答,老半天也没有解决,感谢!数据表字段:日期,合计
Private Sub Command1_Click()
Adodc1.RecordSource = "select * from out"
Adodc1.Refresh
Set MSChart1.DataSource = Adodc1
With MSChart1
.chartType = VtChChartType2dLine
.Plot.Axis(VtChAxisIdY).ValueScale.Auto = False
.Plot.Axis(VtChAxisIdY).ValueScale.Maximum = 1000
.Plot.Axis(VtChAxisIdY).ValueScale.Minimum = 0
.Plot.Axis(VtChAxisIdY).ValueScale.MinorDivision = 1
.Plot.Axis(VtChAxisIdY).ValueScale.MajorDivision = 5
.ColumnCount = 1
.Plot.Axis(VtChAxisIdX, 0).AxisTitle.Text = "日期"
.Plot.Axis(VtChAxisIdY, 0).AxisTitle.Text = "合计"
.Plot.Axis(VtChAxisIdX, 0).AxisTitle.VtFont.Size = 50
.Plot.Axis(VtChAxisIdY, 0).AxisTitle.VtFont.Size = 50
.Title.Text = "每日支出折线图"
.ShowLegend = True
Dim i As Integer
For i = 1 To .Plot.SeriesCollection.Count
.Plot.SeriesCollection(i).DataPoints(-1).DataPointLabel.LocationType = VtChLabelLocationTypeAbovePoint
Next
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
Else
Exit Sub
End If
For i = 0 To Adodc1.Recordset.RecordCount - 1
.Column = 1
.RowCount = Adodc1.Recordset.RecordCount
.Row = i + 1
.RowLabel = CStr(Adodc1.Recordset.Fields("日期"))
.Data = Adodc1.Recordset.Fields("合计")
.ColumnLabel = "每日支出合计"
Adodc1.Recordset.MoveNext
Next
End With
End Sub