PNG export
native
Export the chart as a PNG
Matrix status native. Verification types · strong. ChartKit option: ChartKitChartSpecV1.interaction.export.
toPNG draws the SVG on a canvas. Same-origin fonts only; remote images can taint it.
Source: chartkit:packages/core/src/generated/schema.ts:2611
ChartKit spec
Passed validate() during npm run matrix:refresh. The SVG is the server render.
{
"version": "1",
"type": "line",
"data": [
{
"quarter": "Q1",
"units": 40
},
{
"quarter": "Q2",
"units": 55
}
],
"encoding": {
"x": "quarter",
"y": "units"
},
"a11y": {
"alt": "Units rose in Q2."
},
"size": {
"width": 640,
"height": 260
},
"interaction": {
"export": [
"png",
"svg",
"csv"
]
}
}Other libraries
Option names are the paths recorded in the matrix. A grep-only cell names the identifier that matched, not a render test. Markdown copy: export.png.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | native | Chart.toBase64Image | types · strong | chart.js/dist/types/index.d.ts:550 |
| Recharts | none | —SVG; use a third-party rasteriser | absence · absence | — |
| Apache ECharts | native | grep: getDataURL | grep · weak | echarts/types/src/core/echarts.d.ts:249 |
| Highcharts | plugin | grep: exportChartexporting module | grep · weak | highcharts/highcharts.src.d.ts:11337 |
| Plotly.js | native | grep: toImage | grep · weak | @types/plotly.js/index.d.ts:452 |
| Nivo | plugin | — | npm · weak | — |
| Victory | none | — | absence · absence | — |
| visx | none | — | absence · absence | — |
| ApexCharts | native | grep: dataURI | grep · weak | apexcharts/types/apexcharts.d.ts:272 |
| Tremor (npm) | none | — | absence · absence | — |
| Observable Plot | none | — | absence · absence | — |
| Vega-Lite | plugin | —actions export PNG | npm · weak | — |
| AG Charts | native | grep: downloadAgCharts download / getImageDataURL | grep · weak | ag-charts-types/dist/types/src/chartBuilderOptions.d.ts:108 |
| amCharts 5 | plugin | grep: Exporting | grep · weak | @amcharts/amcharts5/.internal/plugins/json/Classes.d.ts:8 |
| Google Charts | native | grep: getImageURI | grep · weak | @types/google.visualization/index.d.ts:646 |
| uPlot | none | — | absence · absence | — |
| TradingView Lightweight Charts | native | grep: takeScreenshot | grep · weak | 1767: takeScreenshot(addTopLayer? |
| MUI X Charts | native pro | grep: exportAsImage | grep · weak | @mui/x-charts-pro/internals/plugins/useChartProExport/useChartProExport.types.d.ts:95 |
| Mermaid (chart-ish diagrams only) | plugin | — | npm · weak | — |
| AntV G2 | unknown | grep: toDataURL | unverified · unknown | — |