请教图表的X坐标标签怎么调用数据库数据?
我的数据库用的是ACCESS,如下图所示:折线图已可正常显示,如下图:
我写的程序如下:
程序代码:
Adodc3.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db.mdb;Persist Security Info=False" Adodc3.RecordSource = "select * from 表" Adodc3.Refresh If Adodc3.Recordset.RecordCount <= 20 Then ReDim DynArra2(9 To 11, 1 To Adodc3.Recordset.RecordCount) End If If Adodc3.Recordset.RecordCount > 20 Then ReDim DynArra2(9 To 11, Int(Adodc3.Recordset.RecordCount - 20) To Adodc3.Recordset.RecordCount) End If For i = Int(Adodc3.Recordset.RecordCount - 20) To Adodc3.Recordset.RecordCount Adodc3.Recordset.AbsolutePosition = i For k = 9 To 11 DynArra2(k, i) = Adodc3.Recordset.Fields(k) Next k Next i MSChart2.Plot.SeriesCollection(1).LegendText = "最大值" MSChart2.Plot.SeriesCollection(2).LegendText = "最小值" MSChart2.Plot.SeriesCollection(3).LegendText = "平均值" MSChart2.ChartData = DynArra2()
现在想请教,图表上的X轴每一列的标签(C1、C2、C3.......)如何调取数据库中时间那一列数据?也就是说X轴每一列的标签是三个数值(最大值、最小值、平均值)生成的时间。
请路过的朋友、高手、版主不吝赐教。谢谢!