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

How to clear/reset radchartview

4 Answers 89 Views
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 20 Sep 2018, 05:12 PM

Hi,

I got a radchartview with some scatterlineseries. When the user changes a parameter, the chart should be updated with a new series. That works but the old series is still on it. I tried radchartview.series.clear, but I would need something to clear/reset the whole chart before adding the new series.

How can i do that, please.

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 21 Sep 2018, 06:38 AM
Hi Patrick,

You can use the following code to reset the chart:
radChartView1.Axes.Purge();
radChartView1.Series.Clear();

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Ian
Top achievements
Rank 1
answered on 04 Dec 2018, 10:50 AM

I have tried this with a pie chart, and I can't delete the 'old' image (User experience means that the old chart image is no longer valid, and user expects to see an empty space, not the old pie chart)

Any more suggestions? 

0
Dimitar
Telerik team
answered on 05 Dec 2018, 07:10 AM
Hi Ian,

If you are not adding another series you will need to invalidate the chart:
radChartView1.Axes.Purge();
radChartView1.Series.Clear();
radChartView1.Invalidate();

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Ian
Top achievements
Rank 1
answered on 05 Dec 2018, 08:54 AM

Perfect! 

Thanks Dimitar

Asked by
Patrick
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Ian
Top achievements
Rank 1
Share this question
or