How to remove or clear previously drawn dimple bar chart.
I did the following to redraw chart with new data:
chart.data = newData; chart.draw();
This will redraw if data is not empty. If new data is empty, previously drawn chart remains and is not getting erased. How to clear the previously drawn chart?
If you are trying to remove the entire chart (shapes and axis and all), you could do:
If you are just trying to remove the bars/lines/shapes and leave the axes and legend intact, you can do :
I think this may actually be a bug related to this one : https://github.com/PMSI-AlignAlytics/dimple/issues/29 to clear out old series if you set chart.data to an empty array.