E
ErikSalt
I am trying to generate a simple chart in asp.net using OWC11.
I have an aspx page that renders the chart image, and while the image
comes back correctly (I can see the chart, chartspace, and gridlines),
I do not see any data(my dataseries does not show up). Also, my
category labels do not show up.
I am using the following simple code in page_load:
string[] categories=new string []{"A","B","C"};
int[]values=new int[]{5,15,10};
ChartSpace space = new ChartSpaceClass();
space.Clear();
ChChart chart = space.Charts.Add(0);
chart.Type=ChartChartTypeEnum.chChartTypeBarClustered;
chart.SetData(ChartDimensionsEnum.chDimCategories,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, categories);
ChSeries series = chart.SeriesCollection.Add(0);
series.Type=ChartChartTypeEnum.chChartTypeBarClustered;
series.SetData(ChartDimensionsEnum.chDimSeriesNames,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, "SeriesName");
series.SetData(ChartDimensionsEnum.chDimValues,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, values);
series.SetData(ChartDimensionsEnum.chDimCategories,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, categories);
Response.Buffer = true;
Response.ContentType = "image/gif";
Response.BinaryWrite((byte[])space.GetPicture ("gif", 500, 500));
Response.End();
Any help anyone can provide on what I am doing wrong here, I would
greatly appreciate it.
I have an aspx page that renders the chart image, and while the image
comes back correctly (I can see the chart, chartspace, and gridlines),
I do not see any data(my dataseries does not show up). Also, my
category labels do not show up.
I am using the following simple code in page_load:
string[] categories=new string []{"A","B","C"};
int[]values=new int[]{5,15,10};
ChartSpace space = new ChartSpaceClass();
space.Clear();
ChChart chart = space.Charts.Add(0);
chart.Type=ChartChartTypeEnum.chChartTypeBarClustered;
chart.SetData(ChartDimensionsEnum.chDimCategories,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, categories);
ChSeries series = chart.SeriesCollection.Add(0);
series.Type=ChartChartTypeEnum.chChartTypeBarClustered;
series.SetData(ChartDimensionsEnum.chDimSeriesNames,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, "SeriesName");
series.SetData(ChartDimensionsEnum.chDimValues,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, values);
series.SetData(ChartDimensionsEnum.chDimCategories,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, categories);
Response.Buffer = true;
Response.ContentType = "image/gif";
Response.BinaryWrite((byte[])space.GetPicture ("gif", 500, 500));
Response.End();
Any help anyone can provide on what I am doing wrong here, I would
greatly appreciate it.