不要瞎猜。这就是MSChart的缺陷,它不会自动移位到第一条记录。见资料:
*****************************************************************
Avoid the MSChart glitch when displaying ADO Recordset data
When you assign an ADO Recordset to an MSChart's DataSource property, the resulting chart may not contain the first row of data. Normally, when you create a Recordset object, ADO automatically moves the cursor to the first record (assuming the recordset contains records). As a result, there's no need to issue the MoveFirst command. Unfortunately, unless you issue this command, MSChart skips over the first record for some reason. As a result, when you use the MSChart control with an ADO Recordset, always move the cursor to the first record before you assign it to the chart, as seen here:
Dim rst As ADODB.Recordset
Dim sql As String
Set rst = New ADODB.Recordset
sql = "SELECT * FROM tblChartData"
With rst
.ActiveConnection = "Provider=Microsoft.Jet" & _
".OLEDB.4.0;Data Source=D:\DBPath\db1.mdb"
.Open sql, , adOpenStatic
.MoveFirst
End With
Set MSChart1.DataSource = rst
rst.Close
Set rst = Nothing
*****************************************************************