Skip to content

Commit

Permalink
embed fix
Browse files Browse the repository at this point in the history
  • Loading branch information
desafinadude committed Dec 2, 2024
1 parent 638d5cb commit 5de9023
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,9 @@ document.addEventListener('DOMContentLoaded', function () {
},
};

if (population_chart) {
console.log('Destroying existing chart');
population_chart.destroy(); // Destroy the previous chart if it exists
}

population_chart = new Chart('population-chart', {

const population_chart_ctx = document.getElementById('population-chart').getContext('2d');
population_chart = new Chart(population_chart_ctx, {
type: 'bar',
options: options,
data: data,
Expand Down

0 comments on commit 5de9023

Please sign in to comment.