The API for chart.js allows one to edit points of the datasets loaded into it, for example:
.update( )Calling update() on
I tried neaumusic solution, but later found out that the only problem with destroy is the scope.
var chart;
function renderGraph() {
// Destroy old graph
if (chart) {
chart.destroy();
}
// Render chart
chart = new Chart(
document.getElementById(idChartMainWrapperCanvas),
chartOptions
);
}
Moving my chart variable outside the function scope, got it working for me.