Skip to content

Export ​

ts
const svg = chart.toSVG();               // a standalone document
const png = await chart.toPNG(2);        // twice the size, theme background
await chart.toPNG(3, 'transparent');
ts
const a = document.createElement('a');
a.href = URL.createObjectURL(png);
a.download = 'chart.png';
a.click();

Headings, notes and everything added by decorate are exported; tooltips are not. PNG files use system fonts, because a browser does not load web fonts inside an image.

MIT License