12 lines
356 B
JavaScript
12 lines
356 B
JavaScript
///Setup del chart desiderato con id univoco
|
|
window.setup = (id, config) => {
|
|
var ctx = document.getElementById(id);
|
|
if (window['tsChart' + id] instanceof Chart) {
|
|
window['tsChart' + id].destroy();
|
|
window['tsChart' + id] = new Chart(ctx, config);
|
|
}
|
|
else {
|
|
window['tsChart' + id] = new Chart(ctx, config);
|
|
}
|
|
|
|
} |