Chart

live example

Explore the API in the live example.

api reference

Chart()
Component implementing a generic chart widget. It extends the [Widget] ../components/widget.html component with all of its available APIs. It extends the following components:
Chart.download(filename)
Downloads the chart as a PNG file. At the moment, fonts are not embedded in the SVG and therefore the chart's font (which is inherited from its parent) must be installed.

Parameters

NameTypeDescription
filenamestringName of the file to download chart at (without extension).

Returns

Widget
Reference to the Widget API.

Examples

// Download the chart under the name 'awesome-chart.png'.
chart.download('awesome-chart')