Chartjs-Charts.js destroy previous data and update

0👍

I actually was able to adjust the following and now I am all set:

var cFD = document.getElementById('Canvas').getContext('2d');
var backgroundFD = document.getElementById('firstDataChart').style.background='white';
if(window.chart && window.chart !== null){
        window.chart.destroy();
    }
window.chart = new Chart(cFD, {...})

Leave a comment