Hi
I am currently using the latest release of the RadControls (2009 SP2). I am trying to create a chart dynamicall but whenever it hits the following line, chart.DefaultView.ChartArea.DataSeries.Add(dataSeries), the application freezes and its just a white screen. There are similar posts about this that says this was fixed in a previous release. Can you tell me if this is still a bug or if I am doing something wrong.
Thanks
Mark
I am currently using the latest release of the RadControls (2009 SP2). I am trying to create a chart dynamicall but whenever it hits the following line, chart.DefaultView.ChartArea.DataSeries.Add(dataSeries), the application freezes and its just a white screen. There are similar posts about this that says this was fixed in a previous release. Can you tell me if this is still a bug or if I am doing something wrong.
// Create a new Chart element. |
RadChart chart = new RadChart(); |
// Set some chart defaults. |
chart.DefaultView.ChartArea.AxisX.StripLinesVisibility = Visibility.Collapsed; |
chart.DefaultView.ChartArea.AxisY.MajorGridLinesVisibility = Visibility.Collapsed; |
// Create a new DataSeries. |
DataSeries dataSeries = new DataSeries(); |
// Add some hardcoded data points. |
Dictionary<string, double> dataPoints = new Dictionary<string, double>(); |
dataPoints.Add("A", 0.121127226879971); |
dataPoints.Add("B", -0.511961779733487); |
dataPoints.Add("C", -0.394865386295022); |
// Add the datapoints. |
foreach (var point in dataPoints) |
{ |
// Create a new DataPoint. |
DataPoint dataPoint = new DataPoint(); |
dataPoint.XCategory = point.Key; |
dataPoint.YValue = point.Value; |
// Add DataPoint to DataSeries. |
dataSeries.Add(dataPoint); |
} |
// Set the type of graph to draw. |
dataSeries.Definition = new BarSeriesDefinition(); |
// Add DataSeries to Chart |
chart.DefaultView.ChartArea.DataSeries.Add(dataSeries); |
Thanks
Mark