I initially posted this in the Reporint forum because I am using the chart in a Telerik Report, but I haven't recevied a response. Seems like maybe this is a more appropiate place...
I am creating a chart from a SQL datasource. I have two series that are bound to columns on the datasource. If I preview the chart, it looks good and the chart matches the data. My next step is to display my own custom X-Axis labels. I do this by setting PlotArea.XAxis.AutoScale = false and create the items manually. However when I do this and preview the chart, the chart does not look correct (the line does not match the data from the database).
This forum post seems to be related: http://www.telerik.com/community/forums/aspnet/chart/trouble-with-custom-xaxis-labels.aspx
It suggests that I do not set the xvalue inside my chart series. However, I am adding the series by binding to a datasource, so I do not see how to make this work in my case.
//set the datasource
//COMMENT OUT THIS SECTION AND THE CHART LOOKS GOOD
//add new xaxis series items
chart1.PlotArea.XAxis.AddRange(1, 7, 1);
//add the series 1
ChartSeries seriesAvg =
seriesAvg.Type = ChartSeriesType.Area;
//add the series 2
ChartSeries seriesMax =
seriesMax.Type = ChartSeriesType.Line;
Am I doing this totally wrong, or is there a work around?