SVG export
native
Get the chart as an SVG string/file
Matrix status native. Verification types · strong. ChartKit option: ChartKitChartSpecV1.interaction.export.
toSVG serializes the live SVG.
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.svg.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | none | —canvas | absence · absence | — |
| Recharts | partial | grep: Surfaceserialise the DOM SVG yourself | grep · weak | recharts/types/container/Surface.d.ts:4 |
| Apache ECharts | native | grep: renderToSVGString | grep · weak | echarts/types/dist/shared.d.ts:9106 |
| Highcharts | unknown | exporting.type=image/svg+xmlexporting module | unverified · unknown | — |
| Plotly.js | native | grep: toImageformat: 'svg' | grep · weak | @types/plotly.js/index.d.ts:452 |
| Nivo | partial | Lineserialise DOM SVG | types · strong | @nivo/line/dist/types/Line.d.ts:4 |
| Victory | partial | VictoryChart | types · strong | victory-chart/lib/victory-chart.d.ts:3 |
| visx | partial | LinePath | types · strong | @visx/shape/lib/shapes/LinePath.d.ts:18 |
| ApexCharts | native | grep: dataURI | grep · weak | apexcharts/types/apexcharts.d.ts:272 |
| Tremor (npm) | none | — | absence · absence | — |
| Observable Plot | partial | plotreturns an SVG element | types · strong | @observablehq/plot/src/plot.d.ts:427 |
| Vega-Lite | plugin | —View.toSVG | npm · weak | — |
| AG Charts | unknown | — | conflict · unknown | — |
| amCharts 5 | unknown | — | unverified · unknown | — |
| Google Charts | none | — | absence · absence | — |
| uPlot | none | — | absence · absence | — |
| TradingView Lightweight Charts | none | — | absence · absence | — |
| MUI X Charts | unknown | — | conflict · unknown | — |
| Mermaid (chart-ish diagrams only) | native | grep: rendermermaid.render returns SVG string | grep · weak | mermaid/dist/internals.d.ts:1 |
| AntV G2 | none | — | absence · absence | — |