React ChartsDownload
react logo

Saving chart images by API call.

Download API

We expose the APIs for triggering download via the AgCharts class:

download
TypeFunction
getImageDataURL
TypeFunction

The AgChartInstance can be obtained using a React Ref to our <AgChartsReact /> tag, which exposes a chart property.

This example demonstrates:

  • How to obtain a reference to an AgChartInstance.
  • How to use AgCharts.download() to start a chart image download.
  • How to use AgCharts.getImageDataURL() to create a base64-encoded image URL, and then open it in a new tab.