Skip to content

charton API


charton API / @chart-on/vue / index / useChart

Function: useChart() ​

useChart(): Readonly<ShallowRef<Chart | null>>

Defined in: context.ts:13

The chart of the nearest enclosing <Chart> or <ChartShell>, as a ref. It holds null during server rendering and until the component has mounted, then the chart, so a watch on it runs once the chart exists. Outside a chart component it always holds null.

Returns ​

Readonly<ShallowRef<Chart | null>>