Function: useChart()
ts
function useChart<F, View>(dashboard, spec): UseChart;Defined in: packages/svelte/src/runes.svelte.ts:116
Add a chart to a dashboard for as long as the calling component lives.
Pass the spec as a getter to make it reactive. The chart is recreated (and its filter cleared) when the dashboard or the spec's id, dimension, value or extra change; a change to view or renderer only redraws it.
Type Parameters
| Type Parameter | Default type |
|---|---|
F extends string | - |
View | unknown |
Parameters
| Parameter | Type |
|---|---|
dashboard | DashboardSource<F> |
spec | MaybeGetter<ChartSpec<F, View>> |