column of data from a flexgrid to MSChart
Hello
I'm trying to send a column of data from a flexgrid to MSChart to plot. But, with this code all I get is the last entry of the first column. This number is the same across the chart x-axis. So the chart has a straight line left to right.
I wanted all the values of the single column plotted. My chart has years as the x-axis and amount as the y-axis.
Code:
For iRowCount = 1 To tempview1.MSFlexGrid1.Rows - 2
For iColumnCount = 1 To 12
' assign a FlexGrid cell's data to dCurrData
dCurrData = tempview1.MSFlexGrid1.TextMatrix(iRowCount, iColumnCount)
With MSChart1
.ColumnCount = 1
.Column = iColumnCount
.Row = iRowCount
.RowCount = tempview1.MSFlexGrid1.Rows -2
.Column = iColumnCount
.Data = dCurrData
.enabled = True
End With
Next iColumnCount
Next iRowCount
any help is much appreciated
Steve
Re: column of data from a flexgrid to MSChart
In the following code you set MsChart1.ColumnCount to 1 (red line ) and some rows later you set the same value to iColumnCount ( two times - Blue lines). So there must be a logical issue here.
Code:
For iRowCount = 1 To tempview1.MSFlexGrid1.Rows - 2
For iColumnCount = 1 To 12
' assign a FlexGrid cell's data to dCurrData
dCurrData = tempview1.MSFlexGrid1.TextMatrix(iRowCount, iColumnCount)
With MSChart1
.ColumnCount = 1
.Column = iColumnCount
.Row = iRowCount
.RowCount = tempview1.MSFlexGrid1.Rows -2
.Column = iColumnCount
.Data = dCurrData
.enabled = True
End With
Next iColumnCount
Next iRowCount
If there would be some more code I would test it out whats going on here.
Hope that helps
Jonny Poet :wave: