C
Cindy Lliu
Hi,
I'm new on OWC11. I tried to plot a chart. But I got
problem when calling SetData method. Here is my code.
ChCharts oCharts=axChartSpace1.Charts;
ChChart oChart=oCharts.Add(0);
oChart.Type=ChartChartTypeEnum.chChartTypeScatterSmoothLine
Markers;
int [,] categories={{1,1},{2,2},{3,3},{4,4}};
int [] xValues={1,2,3,4};
int [] yValues={1,2,3,4};
ChSeriesCollection oCol=oChart.SeriesCollection;
ChSeries oSeries=oChart.SeriesCollection.Add(0);
oChart.SetData(ChartDimensionsEnum.chDimValues,(int)
(ChartSpecialDataSourcesEnum.chDataLiteral),categories);
I also tried ...
oChart.SetData(ChartDimensionsEnum.chDimYValues,(int)
(ChartSpecialDataSourcesEnum.chDataLiteral),yValues);
oChart.SetData(ChartDimensionsEnum.chDimXValues,(int)
(ChartSpecialDataSourcesEnum.chDataLiteral),xValues);
and ...
oSeries.SetData(ChartDimensionsEnum.chDimYValues,(int)
(ChartSpecialDataSourcesEnum.chDataLiteral),yValues);
oSeries.SetData(ChartDimensionsEnum.chDimXValues,(int)
(ChartSpecialDataSourcesEnum.chDataLiteral),xValues);
They all gave me the runtime error.
Can anybody help me out here?
Thanks in advance!!!
Cindy
I'm new on OWC11. I tried to plot a chart. But I got
problem when calling SetData method. Here is my code.
ChCharts oCharts=axChartSpace1.Charts;
ChChart oChart=oCharts.Add(0);
oChart.Type=ChartChartTypeEnum.chChartTypeScatterSmoothLine
Markers;
int [,] categories={{1,1},{2,2},{3,3},{4,4}};
int [] xValues={1,2,3,4};
int [] yValues={1,2,3,4};
ChSeriesCollection oCol=oChart.SeriesCollection;
ChSeries oSeries=oChart.SeriesCollection.Add(0);
oChart.SetData(ChartDimensionsEnum.chDimValues,(int)
(ChartSpecialDataSourcesEnum.chDataLiteral),categories);
I also tried ...
oChart.SetData(ChartDimensionsEnum.chDimYValues,(int)
(ChartSpecialDataSourcesEnum.chDataLiteral),yValues);
oChart.SetData(ChartDimensionsEnum.chDimXValues,(int)
(ChartSpecialDataSourcesEnum.chDataLiteral),xValues);
and ...
oSeries.SetData(ChartDimensionsEnum.chDimYValues,(int)
(ChartSpecialDataSourcesEnum.chDataLiteral),yValues);
oSeries.SetData(ChartDimensionsEnum.chDimXValues,(int)
(ChartSpecialDataSourcesEnum.chDataLiteral),xValues);
They all gave me the runtime error.
Can anybody help me out here?
Thanks in advance!!!
Cindy