3 dimensional array with MSChart
I want to use a 3 dimensional array with MSChart to add multiple lines the chart. My project worked fine until I added the 3rd dimension to the array.
Here is part of the code. I hope it is enough.
ReDim chrtArray(1 To 2, 1 To lGreatestValue, 1 To 2)
MSChart1.ShowLegend = True
MSChart1.chartType = VtChChartType2dLine
'
'Chart X and Y axis titles
'
MSChart1.Plot.Axis(VtChAxisIdX).AxisTitle.Text = cboDateType.Text
MSChart1.Plot.Axis(VtChAxisIdY).AxisTitle.Text = ""
'
'Load the array with 0s with correct # of rows
'
For X = 1 To lGreatestValue
chrtArray(1, X, 1) = 0
chrtArray(1, X, 2) = X
Next X
'
'Load the array with data
'
For X = 1 To rstCategories.RecordCount
chrtArray(1, rstCategories!datetype, 1) = rstCategories!Calls
rstCategories.MoveNext
Next X
'
'Attach the array of data to MS-CHART
'
With MSChart1
.ChartData = chrtArray :(:(:( I think the problem is here :(:(:(
.ColumnCount = 1
.ColumnLabelCount = 1
.Column = 1
.ColumnLabel = "Call Volume"
|