Fix: Better memory/tooltip/clean-up managers, various fixes.

This commit is contained in:
gerlofvanek
2025-05-08 21:01:02 +02:00
parent d57a148ff4
commit 868b2475c1
7 changed files with 1266 additions and 856 deletions

View File

@@ -578,7 +578,7 @@ const chartModule = {
this.chartRefs.set(element, chart);
},
destroyChart: function() {
destroyChart: function() {
if (chartModule.chart) {
try {
const chartInstance = chartModule.chart;
@@ -592,12 +592,17 @@ const chartModule = {
if (canvas) {
chartModule.chartRefs.delete(canvas);
const ctx = canvas.getContext('2d');
if (ctx) {
ctx.clearRect(0, 0, canvas.width, canvas.height);
}
}
} catch (e) {
console.error('Error destroying chart:', e);
}
}
},
},
initChart: function() {
this.destroyChart();