Skip to content

Function: chart() ​

ts
function chart<View>(node, params): ActionReturn<ChartParams<View>>;

Defined in: packages/svelte/src/index.ts:31

An action that adds a chart and draws it in the element with the spec's renderer or the dashboard's. The chart lives as long as the element. A new dashboard or a change to the spec's id, dimension, value or extra recreates it; a new view or renderer only redraws it.

svelte
<div use:chart={{ dashboard: dash.current, spec }}></div>

Type Parameters ​

Type ParameterDefault type
Viewunknown

Parameters ​

ParameterType
nodeHTMLElement
paramsChartParams<View>

Returns ​

ActionReturn<ChartParams<View>>

Released under the MIT License.