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 Parameter | Default type |
|---|---|
View | unknown |
Parameters
| Parameter | Type |
|---|---|
node | HTMLElement |
params | ChartParams<View> |
Returns
ActionReturn<ChartParams<View>>