16
votes

I'm using the free version of AmCharts, and I have a simple question - how do you delete a Chart after it has been loaded? I've searched the internet, but haven't come up on much.

3
Try to nullify the dataProvider.Anurag

3 Answers

25
votes

If you want to destroy the chart object, at all, call:

chart.clear();

and then null the chart variable:

chart = null;
1
votes

If by delete you mean delete from the page or to hide it, you could also use:

document.getElementById('[[ChartDIV]]').style.display = 'none';
0
votes

Also you can destroy(delete) the chart using these two simple methods

  • chart is not a key word you can change whatever you want to name your chart for example my chart name is ActionPieChart ActionPieChart.destroy();

chart.destroy();

or

chart= null;