Skip to content

Function: fromJSON() ​

ts
function fromJSON(el, json, options?): Chart;

Create a chart from a saved figure: figureFromJSON then createChart.

Parameters ​

ParameterType
elHTMLElement
jsonunknown
options?ChartOptions

Returns ​

Chart

Example ​

ts
const chart = fromJSON(el, await (await fetch('/figures/sales.json')).text());
await chart.ready;

Released under the MIT License.