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