Imran Qamer Imran Qamer - 22 days ago 4x
CSS Question

How to unrender/detach/remove ZingChart library from specific div?

I used below code to render zingchart which works fine.

id : 'myChart',
data : myConfig,
height: 400,
width: "100%"

Now in some occasion I want to un render or detach it. I Mean when I click on some specific place this div with id
should be empty and zing chart should be removed from it.

How can i achieve it?

I tried this jquery code as well.


Thanks in advance.


Full disclosure, I'm a member of the ZingChart team.

Deleting the DOM element the chart is attached to will not delete the chart from memory. At this point you will have something along the lines of a dangling reference. You achieve proper destruction using our api method destroy