I'm using (have to) a framework that will eventually create a Chart with ChartJS, but it doesn't give me the instance of the chart.
Is there a way of retrieving this instance having only the canvas Id?
destroy() Use this to destroy any chart instances that are created. This will clean up any references stored to the chart object within Chart. js, along with any associated event listeners attached by Chart.
Just loop through Chart.instances
Chart.helpers.each(Chart.instances, function(instance){
alert(instance.chart.canvas.id)
})
Fiddle - http://jsfiddle.net/bkq5Lq8b/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With