How to unlock / disconnect / remove ZingChart library from a specific div?

I used below code for zingchart rendering which works great.

zingchart.render({ 
    id : 'myChart', 
    data : myConfig, 
    height: 400, 
    width: "100%"
});

Now sometimes I want to un render or disconnect . I mean, when I click on a specific place, this div with id myChartshould be empty and the zing diagram should be removed from it.

How can i achieve this?

I tried this jquery code.

$("#myChart").html('');

Thanks in advance.

+4
source share
1 answer

Full disclosure, I am a member of the ZingChart team.

DOM, , . - . , api destroy

zingchart.exec('myChart','destroy');
+5

Source: https://habr.com/ru/post/1656194/


All Articles