I am using the Chart.js library to draw a bar graph, it is working fine, but now I want to destroy the bar graph and make
I always use only 1 graph/page. Destroy() solved the issues.
if ( window.myLine !== undefined && window.myLine !== null ) { window.myLine.destroy(); } window.myLine = new Chart(graphCanvasCtx, config);