S
Søren Christensen
I'm running code on a windows form with the chart 10.0
and gets an error. It seems that the setData method
generates an error?
Does anyone have any information one how to upgrade your
code when going from chart 9.0 to 10.0 ?
Well, info on 11.0 would be nice as well.
The error:
An unhandled exception of
type 'System.Runtime.InteropServices.COMException'
occurred in microsoft.visualbasic.dll
Additional information: Member not found.
Here is the code:
'Sub BindChartToArrays()
Dim asSeriesNames(1)
Dim asCategories(7)
Dim aiValues(7)
Dim chConstants
Dim chtNewChart
asSeriesNames(0) = "Satisfaction Data"
asCategories(0) = "Very Good"
asCategories(1) = "Good"
asCategories(2) = "N/A"
asCategories(3) = "Average"
asCategories(4) = "No Response"
asCategories(5) = "Poor"
asCategories(6) = "Very Poor"
aiValues(0) = 10
aiValues(1) = 22
aiValues(2) = 6
aiValues(3) = 31
aiValues(4) = 5
aiValues(5) = 14
aiValues(6) = 12
chConstants = AxChartSpace1.Constants
' Add a new chart to Chartspace1.
chtNewChart = AxChartSpace1.Charts.Add
' Specify that the chart is a column chart.
chtNewChart.Type =
chConstants.chChartTypeColumnClustered
' Bind the chart to the arrays.
chtNewChart.SetData(chConstants.chDimSeriesNames,
chConstants.chDataLiteral, asSeriesNames)
chtNewChart.SetData(chConstants.chDimCategories,
chConstants.chDataLiteral, asCategories)
chtNewChart.SeriesCollection(0).SetData
(chConstants.chDimValues, chConstants.chDataLiteral,
aiValues)
'End Sub
and gets an error. It seems that the setData method
generates an error?
Does anyone have any information one how to upgrade your
code when going from chart 9.0 to 10.0 ?
Well, info on 11.0 would be nice as well.
The error:
An unhandled exception of
type 'System.Runtime.InteropServices.COMException'
occurred in microsoft.visualbasic.dll
Additional information: Member not found.
Here is the code:
'Sub BindChartToArrays()
Dim asSeriesNames(1)
Dim asCategories(7)
Dim aiValues(7)
Dim chConstants
Dim chtNewChart
asSeriesNames(0) = "Satisfaction Data"
asCategories(0) = "Very Good"
asCategories(1) = "Good"
asCategories(2) = "N/A"
asCategories(3) = "Average"
asCategories(4) = "No Response"
asCategories(5) = "Poor"
asCategories(6) = "Very Poor"
aiValues(0) = 10
aiValues(1) = 22
aiValues(2) = 6
aiValues(3) = 31
aiValues(4) = 5
aiValues(5) = 14
aiValues(6) = 12
chConstants = AxChartSpace1.Constants
' Add a new chart to Chartspace1.
chtNewChart = AxChartSpace1.Charts.Add
' Specify that the chart is a column chart.
chtNewChart.Type =
chConstants.chChartTypeColumnClustered
' Bind the chart to the arrays.
chtNewChart.SetData(chConstants.chDimSeriesNames,
chConstants.chDataLiteral, asSeriesNames)
chtNewChart.SetData(chConstants.chDimCategories,
chConstants.chDataLiteral, asCategories)
chtNewChart.SeriesCollection(0).SetData
(chConstants.chDimValues, chConstants.chDataLiteral,
aiValues)
'End Sub