diff --git a/covid19-site/src/main/resources/templates/main-page.html b/covid19-site/src/main/resources/templates/main-page.html index d7be108..50d73b8 100644 --- a/covid19-site/src/main/resources/templates/main-page.html +++ b/covid19-site/src/main/resources/templates/main-page.html @@ -93,7 +93,11 @@ : 0 ); - var myChart = new Chart(ctx, { + if (window.myChart) { + window.myChart.destroy(); + } + + window.myChart = new Chart(ctx, { type: 'line', data: { labels: labels,