Files
mapo-core/MP.INVE/wwwroot/lib/chartBoot.js
T
2022-11-10 17:36:31 +01:00

12 lines
353 B
JavaScript

///Setup del chart desiderato con id univoco
window.setup = (id, config) => {
var ctx = document.getElementById(id).getContext('2d');
if (window['myChart'] instanceof Chart) {
window['myChart'].destroy();
window['myChart'] = new Chart(ctx, config);
}
else {
window['myChart'] = new Chart(ctx, config);
}
}