Features · export

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.

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.png.md.

LibraryStatusOptionVerificationSource
Chart.jsnativeChart.toBase64Imagetypes · strongchart.js/dist/types/index.d.ts:550
Rechartsnone—SVG; use a third-party rasteriserabsence · absence—
Apache EChartsnativegrep: getDataURLgrep · weakecharts/types/src/core/echarts.d.ts:249
Highchartsplugingrep: exportChartexporting modulegrep · weakhighcharts/highcharts.src.d.ts:11337
Plotly.jsnativegrep: toImagegrep · weak@types/plotly.js/index.d.ts:452
Nivoplugin—npm · weak—
Victorynone—absence · absence—
visxnone—absence · absence—
ApexChartsnativegrep: dataURIgrep · weakapexcharts/types/apexcharts.d.ts:272
Tremor (npm)none—absence · absence—
Observable Plotnone—absence · absence—
Vega-Liteplugin—actions export PNGnpm · weak—
AG Chartsnativegrep: downloadAgCharts download / getImageDataURLgrep · weakag-charts-types/dist/types/src/chartBuilderOptions.d.ts:108
amCharts 5plugingrep: Exportinggrep · weak@amcharts/amcharts5/.internal/plugins/json/Classes.d.ts:8
Google Chartsnativegrep: getImageURIgrep · weak@types/google.visualization/index.d.ts:646
uPlotnone—absence · absence—
TradingView Lightweight Chartsnativegrep: takeScreenshotgrep · weak1767: takeScreenshot(addTopLayer?
MUI X Chartsnative progrep: exportAsImagegrep · weak@mui/x-charts-pro/internals/plugins/useChartProExport/useChartProExport.types.d.ts:95
Mermaid (chart-ish diagrams only)plugin—npm · weak—
AntV G2unknowngrep: toDataURLunverified · unknown—