0👍
✅
Got it:
window.setup = (id, config) => {
var myChart = Chart.getChart(id);
if (myChart != undefined) {
myChart.destroy();
}
var ctx = document.getElementById(id).getContext('2d');
new Chart(ctx, config);
console.log(config);
}
(First it was not working for reasons of the browsers cache)
Source:stackexchange.com