Features · export

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.

Units rose in Q2.Units rose in Q2.40455055Q1Q2
{
  "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.

LibraryStatusOptionVerificationSource
Chart.jsnone—canvasabsence · absence—
Rechartspartialgrep: Surfaceserialise the DOM SVG yourselfgrep · weakrecharts/types/container/Surface.d.ts:4
Apache EChartsnativegrep: renderToSVGStringgrep · weakecharts/types/dist/shared.d.ts:9106
Highchartsunknownexporting.type=image/svg+xmlexporting moduleunverified · unknown—
Plotly.jsnativegrep: toImageformat: 'svg'grep · weak@types/plotly.js/index.d.ts:452
NivopartialLineserialise DOM SVGtypes · strong@nivo/line/dist/types/Line.d.ts:4
VictorypartialVictoryCharttypes · strongvictory-chart/lib/victory-chart.d.ts:3
visxpartialLinePathtypes · strong@visx/shape/lib/shapes/LinePath.d.ts:18
ApexChartsnativegrep: dataURIgrep · weakapexcharts/types/apexcharts.d.ts:272
Tremor (npm)none—absence · absence—
Observable Plotpartialplotreturns an SVG elementtypes · strong@observablehq/plot/src/plot.d.ts:427
Vega-Liteplugin—View.toSVGnpm · weak—
AG Chartsunknown—conflict · unknown—
amCharts 5unknown—unverified · unknown—
Google Chartsnone—absence · absence—
uPlotnone—absence · absence—
TradingView Lightweight Chartsnone—absence · absence—
MUI X Chartsunknown—conflict · unknown—
Mermaid (chart-ish diagrams only)nativegrep: rendermermaid.render returns SVG stringgrep · weakmermaid/dist/internals.d.ts:1
AntV G2none—absence · absence—