Imran Qamer Imran Qamer - 1 year ago 90
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.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download