This is a migrated thread and some comments may be shown as answers.

RadChart Clear takes a very long time

2 Answers 121 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Tibi
Top achievements
Rank 2
Tibi asked on 28 Jan 2011, 04:57 PM
Hello,

We are using the Silverlight controls, version 2010 Q3 to create some reports, using a fairly large dataset. The code used to reset a chart dataset is the following:

radChart1.DefaultView.ChartArea.AdditionalYAxes.Clear();
            radChart1.DefaultView.ChartArea.DataSeries.Clear();
            radChart1.DefaultView.ChartLegend.Items.Clear();
            radChart1.SeriesMappings.Clear();
            radChart2.DefaultView.ChartArea.AdditionalYAxes.Clear();
            radChart2.DefaultView.ChartArea.DataSeries.Clear();
            radChart2.DefaultView.ChartLegend.Items.Clear();
            radChart2.SeriesMappings.Clear();

One of the problems is that when we try to re-run a report (recreate the chart with a new or same dataset) the following "stages" appear every time:

1 - it takes a huge amount of time (longer the the creation of the new chart itself) until the old dataset is discarded and the Loading control appears (although the isBusy is set to true at the very beginning of the reset process)
2 - there is a lot of CPU activity
3 - at some point, the chart becomes like the screenshot attached (reset data set.png) The normal chart should look like the second screenshot (normal chart.png)

Could you please advise us where to look further as at this point, the re-run of a report is at least awkward with this problems.
Thanks for support.

2 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 02 Feb 2011, 09:44 AM
Hello Marian,

From your code I can see that you are data binding your RadChart using SeriesMappings. In that case clearing the SeriesMappings will automatically clear the chart legend and data series. For better performance you can try clearing the ItemsSource before the series mappings, because this way if the chart tries to rebind itself it won't have any data to bind to. Your code for clearing the charts can look like this:

radChart1.ItemsSource = null;
radChart1.SeriesMappings.Clear();
radChart1.DefaultView.ChartArea.AdditionalYAxes.Clear();
//radChart1.DefaultView.ChartArea.DataSeries.Clear();
//radChart1.DefaultView.ChartLegend.Items.Clear();
 
radChart2.ItemsSource = null;
radChart2.SeriesMappings.Clear();
radChart2.DefaultView.ChartArea.AdditionalYAxes.Clear();
//radChart2.DefaultView.ChartArea.DataSeries.Clear();
//radChart2.DefaultView.ChartLegend.Items.Clear();

Hope this helps!

Greetings,
Yavor Ivanov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Tibi
Top achievements
Rank 2
answered on 02 Feb 2011, 08:11 PM
Thanks, your solution worked perfectly.

Best regards.

Marian Vulpe
Spectra Computers
Tags
Chart
Asked by
Tibi
Top achievements
Rank 2
Answers by
Yavor
Telerik team
Tibi
Top achievements
Rank 2
Share this question
or