fixed export png function

This commit is contained in:
dlawler489 2025-04-27 18:21:39 +10:00
parent e10e838745
commit 93ecc88ade
2 changed files with 5 additions and 4 deletions

View file

@ -43,7 +43,7 @@
<div id="loading">Loading chart, please wait...</div>
<svg width="1400" height="600"></svg>
<svg id="chart" width="1400" height="600"></svg>
<div class="legend" id="legend"></div>

View file

@ -179,7 +179,8 @@ d3.csv("PHSwithContinent.csv").then(function(data) {
].filter(Boolean);
const filename = parts.join("_") + ".png";
saveSvgAsPng.saveSvgAsPng(document.querySelector("svg"), filename);
saveSvgAsPng(document.getElementById("chart"), filename);
});
});