Skip to content

charton API


charton API / @chart-on/react / index / ChartProps

Interface: ChartProps ​

Defined in: chart.ts:7

The props of <Chart>: chart options and data, plus event handlers and container attributes.

Extends ​

Properties ​

children? ​

optional children?: ReactNode

Defined in: chart.ts:20

Rendered inside the container; useChart() in them returns this chart.


className? ​

optional className?: string

Defined in: chart.ts:17


dataSource? ​

optional dataSource?: DataSource | null

Defined in: sync.ts:20

Where bars come from. Changing it attaches the new source and loads symbol again. The chart needs the dataSource() plugin in options.plugins (or builtins()); without it the source is not attached and development builds warn once (data-source-missing).

Inherited from ​

ChartInputs.dataSource


id? ​

optional id?: string

Defined in: chart.ts:16

Attributes of the container element. Give it a height: the chart fills it.


interval? ​

optional interval?: Interval

Defined in: sync.ts:23

Inherited from ​

ChartInputs.interval


on? ​

optional on?: ChartEventHandlers

Defined in: chart.ts:14

Chart events to listen to, keyed by event name, e.g. { 'crosshair:move': (e) => … }. Only the events listed here are subscribed. A new callback for the same event is used without subscribing again.


options? ​

optional options?: ChartOptionsPatch

Defined in: sync.ts:14

Chart options. Given to the chart when it is created, then applied with applyOptions whenever they change. They are compared by value, so an object literal written inline does not apply again on every render.

Inherited from ​

ChartInputs.options


style? ​

optional style?: CSSProperties

Defined in: chart.ts:18


symbol? ​

optional symbol?: string

Defined in: sync.ts:22

Symbol to load from dataSource; loads once both it and interval are set.

Inherited from ​

ChartInputs.symbol