We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Chart.Series.Clear() function takes forvever

Thread ID:

Created:

Updated:

Platform:

Replies:

99364 May 16,2011 03:51 PM Feb 24,2015 07:34 AM Windows Forms 7
loading
Tags: Chart
Youfei Chen
Asked On May 16, 2011 03:51 PM

Hi

I have more than two thousand series contained in the Chart.Series collection, when I call Chart.Series.Clear(), it takes forever to clear the list.

I did call Chart.Series.BeginUpdate() before and Chart.Series.EndUpdate() after, but it doesnt help.

Thanks,
Youfei


Vijayabharathi K [Syncfusion]
Replied On May 17, 2011 02:35 AM

Hi Youfei,

Thanks for using Syncfusion products.

The “Series.clear()” method to takes 2 to 3 minutes for clear the more than 2000 series in chart control. If your intention is to clear the series from chart area in a seconds means, we suggest you to use “ResetSeriesModel()” method to reset the chart series model in chart area. Please refer the below code snippet to achieve this,

[C#]

for (int k = this.chartControl1.Series.Count -1; k >= 0; k--)
this.chartControl1.Series[k].ResetSeriesModel();

Please let us know if have any concern.

Regards,
Vijayabharathi




Youfei Chen
Replied On May 17, 2011 04:08 PM

Hi Vijay

Thanks for your quick response. Your method does its job, in terms of cleaning the chart, but my application needs to regularly update the chart, which means I will have to add another several k series to the chart shortly after the chart was cleared. So if I just reset the model instead of clearing the series, syncfusion throws an exception of "System.StackOverflowException" which I believe because your workaround leaves series behind.

Any idea?

Thanks,
Youfei


Vijayabharathi K [Syncfusion]
Replied On May 20, 2011 03:38 AM

Hi Youfei,

Thanks for the update.

The “Series.Clear() function takes time while clear the more than 2000 chart series” issue has been confirmed as a defect.
Could you please open a new incident in Direct-Trac for this issue? so that we could provide you a patch for this issue.

Please let us know if you have any concern.

Regards,
Vijayabharathi




Youfei Chen
Replied On June 1, 2011 04:01 PM

I was on vocation. Just did it.

Thanks,
Youfei


Vijayabharathi K [Syncfusion]
Replied On June 2, 2011 02:40 AM

Hi Youfei

Thanks for the update.

Regards,
Vijayabharathi


Seamus
Replied On February 23, 2015 05:49 PM

Was this ever fixed? I have a chart that has 1000+ series, and to replot it,  I need to call Chart.Series.Clear(), and this takes more than 2minutes.

Jayavigneshwaran [Syncfusion]
Replied On February 24, 2015 07:34 AM

Hi Youfei,

Thanks for using Syncfusion software.

We have analyzed this.

This can be overcome by setting the below options in chart

[CS]

  this.chartControl1.ImprovePerformance = true;

  this.chartControl1.CalcRegions = false;

  this.chartControl1.NeedPerformance = true;

  series1.EnableStyles = false;

We have made a sample to illustrate this. Find it from the below location
Windows_forms.zip

In this sample , we have added 1000 series and each series has 100 points. Then the series.clear() method is calculated.

This works fine and takes few seconds to clear.

Please let us know if you have any concern.

Thanks,

Jayavigneshwaran



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;