score:0

i found my answer by this way. thanks!

       var ctx = document.getelementbyid("chart-area").getcontext("2d");
               if(mypie!=null){
    mypie.destroy();
}
    mypie = new chart(ctx, config);

score:0

to destroy chart, you need to call "destroy" method on variable, which contains an instance of the chart. simple example for your case:

var ctx = document.getelementbyid("chart-area").getcontext("2d");
var mypie = new chart(ctx, config);

...some additional code...

// destroy mypie instance
mypie.destroy();

Related Query

More Query from same tag