This section shows how the Grid API can be used to save and restore charts.
The example below demonstrates how you can save and then later restore a chart. You can make changes to the chart type, theme, data and formatting options and note how the restored chart looks the same as the chart that was saved.
A chart model that represent all the state information about the rendered charts can be obtained using getChartModels()
. These models are returned in a format that can be easily used with the other API methods to later restore the chart.
Properties available on the ChartModel
interface.
These models can then be supplied to the following grid api method to restore the charts:
Note that an optional chartContainer
can be specified when restoring a chart.
Continue to the next section to learn about: Chart Image Export.