Framework props
The framework bindings wrap the same two chart entry points, so they take the same props — spelled the way each framework expects. Every prop below links to its counterpart in Chart props and Callbacks and payloads, which describe the behaviour and the payloads in full.
This page is generated from the binding packages' own prop declarations, so a prop added to one binding but not another cannot go unnoticed.
Name mapping
Every core prop and the name each binding gives it. Names match the core reference unless the framework's conventions call for something else — Angular exposes callbacks as outputs (no on prefix), and the state factories become placeholder components (templates in Lit).
A — means no binding prop maps to that core prop. Only style sits there, and the reason is worth knowing: it sets inline styles on the chart's own root element (div.mochart-chart), which the bindings do not forward. The style and class/className props listed per binding below are a different prop — they target the container element the binding creates and mounts the chart into, which is the element that also carries the size:
<div style="…"> <!-- the binding's container: its style/class prop -->
<div class="mochart-chart" style="…"> <!-- the chart root: core's style prop -->
<svg>…</svg>
</div>
</div>Vue and Angular list no container props because their frameworks already cover it — Vue passes stray attributes (class, style) through to the container, and Angular styles the component's own host element.
| Core prop | React | Svelte | Vue | Lit | Angular |
|---|---|---|---|---|---|
config | config | config | config | config | config |
data | data | data | data | data | data |
mochartConfig | mochartConfig | mochartConfig | mochartConfig | mochartConfig | mochartConfig |
dataProvider | dataProvider | dataProvider | dataProvider | dataProvider | dataProvider |
width | width | width | width | width | width |
height | height | height | height | height | height |
style | — | — | — | — | — |
loading | loading | loading | loading | loading | loading |
error | error | error | error | error | error |
focusedCategoryIndex | focusedCategoryIndex | focusedCategoryIndex | focusedCategoryIndex | focusedCategoryIndex | focusedCategoryIndex |
focusedValueAxisId | focusedValueAxisId | focusedValueAxisId | focusedValueAxisId | focusedValueAxisId | focusedValueAxisId |
focusedSeriesId | focusedSeriesId | focusedSeriesId | focusedSeriesId | focusedSeriesId | focusedSeriesId |
filteredSeriesIds | filteredSeriesIds | filteredSeriesIds | filteredSeriesIds | filteredSeriesIds | filteredSeriesIds |
getLoadingComponent | loadingComponent | loadingComponent | loadingComponent | loadingTemplate | loadingComponent |
getErrorComponent | errorComponent | errorComponent | errorComponent | errorTemplate | errorComponent |
getNoDataComponent | noDataComponent | noDataComponent | noDataComponent | noDataTemplate | noDataComponent |
getNoSizeComponent | noSizeComponent | noSizeComponent | noSizeComponent | noSizeTemplate | noSizeComponent |
getNoSeriesComponent | noSeriesComponent | noSeriesComponent | noSeriesComponent | noSeriesTemplate | noSeriesComponent |
getConfigErrorComponent | configErrorComponent | configErrorComponent | configErrorComponent | configErrorTemplate | configErrorComponent |
onChartClick | onChartClick | onChartClick | onChartClick | onChartClick | chartClick |
onSliceClick | onSliceClick | onSliceClick | onSliceClick | onSliceClick | sliceClick |
onSeriesClick | onSeriesClick | onSeriesClick | onSeriesClick | onSeriesClick | seriesClick |
onChartMouseEnter | onChartMouseEnter | onChartMouseEnter | onChartMouseEnter | onChartMouseEnter | chartMouseEnter |
onChartMouseMove | onChartMouseMove | onChartMouseMove | onChartMouseMove | onChartMouseMove | chartMouseMove |
onChartMouseLeave | onChartMouseLeave | onChartMouseLeave | onChartMouseLeave | onChartMouseLeave | chartMouseLeave |
onTitleClick | onTitleClick | onTitleClick | onTitleClick | onTitleClick | titleClick |
onFocus | onFocus | onFocus | onFocus | onFocus | focusChange |
onSeriesFilter | onSeriesFilter | onSeriesFilter | onSeriesFilter | onSeriesFilter | seriesFilter |
onSeriesLayoutBoundsChange | onSeriesLayoutBoundsChange | onSeriesLayoutBoundsChange | onSeriesLayoutBoundsChange | onSeriesLayoutBoundsChange | seriesLayoutBoundsChange |
React
@mochart/react — component props on Chart and DefaultChart. See the React guide for setup and examples.
- No
styleprop: the binding has its own style prop, applied to the container div it renders rather than forwarded to core.
Entry-point props
The config and data source. The Chart entry point takes mochartConfig and dataProvider; the DefaultChart one takes config and data. Both are required on the entry point that declares them.
| Prop | Type | Core prop | Description |
|---|---|---|---|
mochartConfig | MochartConfig | null | mochartConfig | The enhanced config produced by enhanceConfig (validated, defaults applied); null while the host is still loading it. |
dataProvider | DataProvider | null | dataProvider | The data source; use a built-in provider or any DataProvider implementation. Null while the host is still loading it. |
config | MochartInputConfig | config | The raw config; validated and enhanced internally on every change. |
data | ArrayOfObjectsData | ObjectOfArraysData | data | The dataset in either built-in shape — array of objects (one per category) or object of arrays (one per property); wrapped in the matching provider. |
Chart props
Sizing, container styling, state, and the controlled focus and filter props.
| Prop | Type | Core prop | Description |
|---|---|---|---|
width | number | width | Explicit pixel width; omit to track the container element's width. |
height | number | height | Explicit pixel height; omit to track the container element's height. |
className | string | — | Class applied to the container div the chart mounts into. |
style | CSSProperties | — | Style applied to the container div the chart mounts into. |
dataTestId | string | — | data-testid attribute applied to the container div, for test selectors. |
loading | boolean | loading | Switches the chart into its loading state (see getLoadingComponent). |
error | unknown | error | Switches the chart into its error state when set to anything but null/undefined — '' and 0 count (see getErrorComponent). |
focusedCategoryIndex | number | focusedCategoryIndex | Controlled focused category index (-1 = none). When set it overrides the chart's internal focus on every render; pass back the value reported by onFocus to keep several charts in sync. Omit to leave focus chart-managed. |
focusedValueAxisId | string | null | focusedValueAxisId | Controlled focused value-axis id (null = none). See focusedCategoryIndex. |
focusedSeriesId | string | null | focusedSeriesId | Controlled focused series id (null = none); use the id of a series that does not set followSeries. See focusedCategoryIndex. |
filteredSeriesIds | Record<string, boolean> | filteredSeriesIds | Controlled filter map (series id → true = filtered out); pass back the map reported by onSeriesFilter to sync legend filtering across charts. Key it by series that do not set followSeries: a series that follows another filters with it. |
Callbacks
The chart callbacks, reporting the payloads documented in the core reference.
| Prop | Type | Core prop | Description |
|---|---|---|---|
onChartClick | (eventPayload: ChartEventPayload) => void | onChartClick | The plot area was clicked. |
onSliceClick | (payload: ChartSliceClickPayload) => void | onSliceClick | A pie-type slice was clicked; fires only on click (unlike hover-driven onFocus), so it can anchor selection. |
onSeriesClick | (payload: ChartSeriesClickPayload) => void | onSeriesClick | A cartesian series shape (bar, marker, label, line/area path) was clicked. Independent of focusOnClick; fires only on click, so it can anchor selection. |
onChartMouseEnter | (eventPayload: ChartEventPayload) => void | onChartMouseEnter | The pointer entered the plot area. |
onChartMouseMove | (eventPayload: ChartEventPayload) => void | onChartMouseMove | The pointer moved within the plot area. |
onChartMouseLeave | (eventPayload: ChartEventPayload) => void | onChartMouseLeave | The pointer left the plot area. |
onTitleClick | () => void | onTitleClick | The chart title was clicked (see title.link/title.linkDisabled). |
onFocus | (focusData: ChartFocus) => void | onFocus | The focused series/category/value axis — via pointer over/click on the plot or the legend, per the focusOnHover/focusOnClick config. |
onSeriesFilter | (filterData: ChartSeriesFilter) => void | onSeriesFilter | A legend click toggled a series in or out of the filtered set (requires legend.filterOnClick). |
onSeriesLayoutBoundsChange | (bounds: Bounds) => void | onSeriesLayoutBoundsChange | The plot area was re-laid-out; reports its new bounds. |
State placeholders
What renders in each non-chart state, in place of the core state factories.
| Prop | Type | Core prop | Description |
|---|---|---|---|
loadingComponent | PlaceholderComponent | getLoadingComponent | Rendered while the loading prop is true. |
errorComponent | PlaceholderComponent | getErrorComponent | Rendered while the error prop is set. |
noDataComponent | PlaceholderComponent | getNoDataComponent | Rendered when the dataset has no categories. |
noSizeComponent | PlaceholderComponent | getNoSizeComponent | Rendered when width or height is not a positive number (0 before a container is laid out). |
noSeriesComponent | PlaceholderComponent | getNoSeriesComponent | Rendered when the config declares no series. |
configErrorComponent | PlaceholderComponent | getConfigErrorComponent | Rendered when the config fails validation. |
Svelte
@mochart/svelte — component props on Chart and DefaultChart. See the Svelte guide for setup and examples.
- No
styleprop: the binding has its own style prop, applied to the container div it renders rather than forwarded to core.
Entry-point props
The config and data source. The Chart entry point takes mochartConfig and dataProvider; the DefaultChart one takes config and data. Both are required on the entry point that declares them.
| Prop | Type | Core prop | Description |
|---|---|---|---|
mochartConfig | MochartConfig | null | mochartConfig | The enhanced config produced by enhanceConfig (validated, defaults applied); null while the host is still loading it. |
dataProvider | DataProvider | null | dataProvider | The data source; use a built-in provider or any DataProvider implementation. Null while the host is still loading it. |
config | MochartInputConfig | config | The raw config; validated and enhanced internally on every change. |
data | ArrayOfObjectsData | ObjectOfArraysData | data | The dataset in either built-in shape — array of objects (one per category) or object of arrays (one per property); wrapped in the matching provider. |
Chart props
Sizing, container styling, state, and the controlled focus and filter props.
| Prop | Type | Core prop | Description |
|---|---|---|---|
width | number | width | Explicit pixel width; omit to track the container element's width. |
height | number | height | Explicit pixel height; omit to track the container element's height. |
class | string | — | Class applied to the container div the chart mounts into. |
style | string | — | Style applied to the container div the chart mounts into. |
dataTestId | string | — | data-testid attribute applied to the container div, for test selectors. |
loading | boolean | loading | Switches the chart into its loading state (see getLoadingComponent). |
error | unknown | error | Switches the chart into its error state when set to anything but null/undefined — '' and 0 count (see getErrorComponent). |
focusedCategoryIndex | number | focusedCategoryIndex | Controlled focused category index (-1 = none). When set it overrides the chart's internal focus on every render; pass back the value reported by onFocus to keep several charts in sync. Omit to leave focus chart-managed. |
focusedValueAxisId | string | null | focusedValueAxisId | Controlled focused value-axis id (null = none). See focusedCategoryIndex. |
focusedSeriesId | string | null | focusedSeriesId | Controlled focused series id (null = none); use the id of a series that does not set followSeries. See focusedCategoryIndex. |
filteredSeriesIds | Record<string, boolean> | filteredSeriesIds | Controlled filter map (series id → true = filtered out); pass back the map reported by onSeriesFilter to sync legend filtering across charts. Key it by series that do not set followSeries: a series that follows another filters with it. |
Callbacks
The chart callbacks, reporting the payloads documented in the core reference.
| Prop | Type | Core prop | Description |
|---|---|---|---|
onChartClick | (eventPayload: ChartEventPayload) => void | onChartClick | The plot area was clicked. |
onSliceClick | (payload: ChartSliceClickPayload) => void | onSliceClick | A pie-type slice was clicked; fires only on click (unlike hover-driven onFocus), so it can anchor selection. |
onSeriesClick | (payload: ChartSeriesClickPayload) => void | onSeriesClick | A cartesian series shape (bar, marker, label, line/area path) was clicked. Independent of focusOnClick; fires only on click, so it can anchor selection. |
onChartMouseEnter | (eventPayload: ChartEventPayload) => void | onChartMouseEnter | The pointer entered the plot area. |
onChartMouseMove | (eventPayload: ChartEventPayload) => void | onChartMouseMove | The pointer moved within the plot area. |
onChartMouseLeave | (eventPayload: ChartEventPayload) => void | onChartMouseLeave | The pointer left the plot area. |
onTitleClick | () => void | onTitleClick | The chart title was clicked (see title.link/title.linkDisabled). |
onFocus | (focusData: ChartFocus) => void | onFocus | The focused series/category/value axis — via pointer over/click on the plot or the legend, per the focusOnHover/focusOnClick config. |
onSeriesFilter | (filterData: ChartSeriesFilter) => void | onSeriesFilter | A legend click toggled a series in or out of the filtered set (requires legend.filterOnClick). |
onSeriesLayoutBoundsChange | (bounds: Bounds) => void | onSeriesLayoutBoundsChange | The plot area was re-laid-out; reports its new bounds. |
State placeholders
What renders in each non-chart state, in place of the core state factories.
| Prop | Type | Core prop | Description |
|---|---|---|---|
loadingComponent | PlaceholderComponent | getLoadingComponent | Rendered while the loading prop is true. |
errorComponent | PlaceholderComponent | getErrorComponent | Rendered while the error prop is set. |
noDataComponent | PlaceholderComponent | getNoDataComponent | Rendered when the dataset has no categories. |
noSizeComponent | PlaceholderComponent | getNoSizeComponent | Rendered when width or height is not a positive number (0 before a container is laid out). |
noSeriesComponent | PlaceholderComponent | getNoSeriesComponent | Rendered when the config declares no series. |
configErrorComponent | PlaceholderComponent | getConfigErrorComponent | Rendered when the config fails validation. |
Vue
@mochart/vue — component props on Chart and DefaultChart. See the Vue guide for setup and examples.
- No
styleprop: class and style are fallthrough attrs in Vue, so they land on the container div automatically.
Entry-point props
The config and data source. The Chart entry point takes mochartConfig and dataProvider; the DefaultChart one takes config and data. Both are required on the entry point that declares them.
| Prop | Type | Core prop | Description |
|---|---|---|---|
mochartConfig | MochartConfig | null | mochartConfig | The enhanced config produced by enhanceConfig (validated, defaults applied); null while the host is still loading it. |
dataProvider | DataProvider | null | dataProvider | The data source; use a built-in provider or any DataProvider implementation. Null while the host is still loading it. |
config | MochartInputConfig | config | The raw config; validated and enhanced internally on every change. |
data | ArrayOfObjectsData | ObjectOfArraysData | data | The dataset in either built-in shape — array of objects (one per category) or object of arrays (one per property); wrapped in the matching provider. |
Chart props
Sizing, container styling, state, and the controlled focus and filter props.
| Prop | Type | Core prop | Description |
|---|---|---|---|
width | number | width | Explicit pixel width; omit to track the container element's width. |
height | number | height | Explicit pixel height; omit to track the container element's height. |
dataTestId | string | — | data-testid attribute applied to the container div, for test selectors. |
loading | boolean | loading | Switches the chart into its loading state (see getLoadingComponent). |
error | unknown | error | Switches the chart into its error state when set to anything but null/undefined — '' and 0 count (see getErrorComponent). |
focusedCategoryIndex | number | focusedCategoryIndex | Controlled focused category index (-1 = none). When set it overrides the chart's internal focus on every render; pass back the value reported by onFocus to keep several charts in sync. Omit to leave focus chart-managed. |
focusedValueAxisId | string | null | focusedValueAxisId | Controlled focused value-axis id (null = none). See focusedCategoryIndex. |
focusedSeriesId | string | null | focusedSeriesId | Controlled focused series id (null = none); use the id of a series that does not set followSeries. See focusedCategoryIndex. |
filteredSeriesIds | Record<string, boolean> | filteredSeriesIds | Controlled filter map (series id → true = filtered out); pass back the map reported by onSeriesFilter to sync legend filtering across charts. Key it by series that do not set followSeries: a series that follows another filters with it. |
Callbacks
The chart callbacks, reporting the payloads documented in the core reference.
| Prop | Type | Core prop | Description |
|---|---|---|---|
onChartClick | (eventPayload: ChartEventPayload) => void | onChartClick | The plot area was clicked. |
onSliceClick | (payload: ChartSliceClickPayload) => void | onSliceClick | A pie-type slice was clicked; fires only on click (unlike hover-driven onFocus), so it can anchor selection. |
onSeriesClick | (payload: ChartSeriesClickPayload) => void | onSeriesClick | A cartesian series shape (bar, marker, label, line/area path) was clicked. Independent of focusOnClick; fires only on click, so it can anchor selection. |
onChartMouseEnter | (eventPayload: ChartEventPayload) => void | onChartMouseEnter | The pointer entered the plot area. |
onChartMouseMove | (eventPayload: ChartEventPayload) => void | onChartMouseMove | The pointer moved within the plot area. |
onChartMouseLeave | (eventPayload: ChartEventPayload) => void | onChartMouseLeave | The pointer left the plot area. |
onTitleClick | () => void | onTitleClick | The chart title was clicked (see title.link/title.linkDisabled). |
onFocus | (focusData: ChartFocus) => void | onFocus | The focused series/category/value axis — via pointer over/click on the plot or the legend, per the focusOnHover/focusOnClick config. |
onSeriesFilter | (filterData: ChartSeriesFilter) => void | onSeriesFilter | A legend click toggled a series in or out of the filtered set (requires legend.filterOnClick). |
onSeriesLayoutBoundsChange | (bounds: Bounds) => void | onSeriesLayoutBoundsChange | The plot area was re-laid-out; reports its new bounds. |
State placeholders
What renders in each non-chart state, in place of the core state factories.
| Prop | Type | Core prop | Description |
|---|---|---|---|
loadingComponent | PlaceholderComponent | getLoadingComponent | Rendered while the loading prop is true. |
errorComponent | PlaceholderComponent | getErrorComponent | Rendered while the error prop is set. |
noDataComponent | PlaceholderComponent | getNoDataComponent | Rendered when the dataset has no categories. |
noSizeComponent | PlaceholderComponent | getNoSizeComponent | Rendered when width or height is not a positive number (0 before a container is laid out). |
noSeriesComponent | PlaceholderComponent | getNoSeriesComponent | Rendered when the config declares no series. |
configErrorComponent | PlaceholderComponent | getConfigErrorComponent | Rendered when the config fails validation. |
Lit
@mochart/lit — directive props on chart() and defaultChart(). See the Lit guide for setup and examples.
- No
styleprop: the directive has its own style prop, applied to the container div it renders rather than forwarded to core.
Entry-point props
The config and data source. The Chart entry point takes mochartConfig and dataProvider; the DefaultChart one takes config and data. Both are required on the entry point that declares them.
| Prop | Type | Core prop | Description |
|---|---|---|---|
mochartConfig | MochartConfig | null | mochartConfig | The enhanced config produced by enhanceConfig (validated, defaults applied); null while the host is still loading it. |
dataProvider | DataProvider | null | dataProvider | The data source; use a built-in provider or any DataProvider implementation. Null while the host is still loading it. |
config | MochartInputConfig | config | The raw config; validated and enhanced internally on every change. |
data | ArrayOfObjectsData | ObjectOfArraysData | data | The dataset in either built-in shape — array of objects (one per category) or object of arrays (one per property); wrapped in the matching provider. |
Chart props
Sizing, container styling, state, and the controlled focus and filter props.
| Prop | Type | Core prop | Description |
|---|---|---|---|
chartRef | (ref: ChartRef | null) => void | — | Callback ref, like Lit's own ref() directive: called with the ChartRef handle once the chart mounts and with null when the directive disconnects. |
width | number | width | Explicit pixel width; omit to track the container element's width. |
height | number | height | Explicit pixel height; omit to track the container element's height. |
className | string | — | CSS class for the container div the chart mounts into — the directive equivalent of the class/style fallthrough the component wrappers get. |
style | string | — | Inline style for the container div; explicit width/height props win. |
dataTestId | string | — | data-testid attribute applied to the container div, for test selectors. |
loading | boolean | loading | Switches the chart into its loading state (see getLoadingComponent). |
error | unknown | error | Switches the chart into its error state when set to anything but null/undefined — '' and 0 count (see getErrorComponent). |
focusedCategoryIndex | number | focusedCategoryIndex | Controlled focused category index (-1 = none). When set it overrides the chart's internal focus on every render; pass back the value reported by onFocus to keep several charts in sync. Omit to leave focus chart-managed. |
focusedValueAxisId | string | null | focusedValueAxisId | Controlled focused value-axis id (null = none). See focusedCategoryIndex. |
focusedSeriesId | string | null | focusedSeriesId | Controlled focused series id (null = none); use the id of a series that does not set followSeries. See focusedCategoryIndex. |
filteredSeriesIds | Record<string, boolean> | filteredSeriesIds | Controlled filter map (series id → true = filtered out); pass back the map reported by onSeriesFilter to sync legend filtering across charts. Key it by series that do not set followSeries: a series that follows another filters with it. |
Callbacks
The chart callbacks, reporting the payloads documented in the core reference.
| Prop | Type | Core prop | Description |
|---|---|---|---|
onChartClick | (eventPayload: ChartEventPayload) => void | onChartClick | The plot area was clicked. |
onSliceClick | (payload: ChartSliceClickPayload) => void | onSliceClick | A pie-type slice was clicked; fires only on click (unlike hover-driven onFocus), so it can anchor selection. |
onSeriesClick | (payload: ChartSeriesClickPayload) => void | onSeriesClick | A cartesian series shape (bar, marker, label, line/area path) was clicked. Independent of focusOnClick; fires only on click, so it can anchor selection. |
onChartMouseEnter | (eventPayload: ChartEventPayload) => void | onChartMouseEnter | The pointer entered the plot area. |
onChartMouseMove | (eventPayload: ChartEventPayload) => void | onChartMouseMove | The pointer moved within the plot area. |
onChartMouseLeave | (eventPayload: ChartEventPayload) => void | onChartMouseLeave | The pointer left the plot area. |
onTitleClick | () => void | onTitleClick | The chart title was clicked (see title.link/title.linkDisabled). |
onFocus | (focusData: ChartFocus) => void | onFocus | The focused series/category/value axis — via pointer over/click on the plot or the legend, per the focusOnHover/focusOnClick config. |
onSeriesFilter | (filterData: ChartSeriesFilter) => void | onSeriesFilter | A legend click toggled a series in or out of the filtered set (requires legend.filterOnClick). |
onSeriesLayoutBoundsChange | (bounds: Bounds) => void | onSeriesLayoutBoundsChange | The plot area was re-laid-out; reports its new bounds. |
State placeholders
What renders in each non-chart state, in place of the core state factories.
| Prop | Type | Core prop | Description |
|---|---|---|---|
loadingTemplate | PlaceholderTemplate | getLoadingComponent | Rendered while the loading prop is true. |
errorTemplate | PlaceholderTemplate | getErrorComponent | Rendered while the error prop is set. |
noDataTemplate | PlaceholderTemplate | getNoDataComponent | Rendered when the dataset has no categories. |
noSizeTemplate | PlaceholderTemplate | getNoSizeComponent | Rendered when width or height is not a positive number (0 before a container is laid out). |
noSeriesTemplate | PlaceholderTemplate | getNoSeriesComponent | Rendered when the config declares no series. |
configErrorTemplate | PlaceholderTemplate | getConfigErrorComponent | Rendered when the config fails validation. |
Angular
@mochart/angular — inputs and outputs on <mochart-chart> and <mochart-default-chart>. See the Angular guide for setup and examples.
- No
styleprop: class and style are set on the component element itself, which is the chart container.
Entry-point props
The config and data source. The Chart entry point takes mochartConfig and dataProvider; the DefaultChart one takes config and data. Both are required on the entry point that declares them.
| Prop | Type | Core prop | Description |
|---|---|---|---|
mochartConfig | MochartConfig | null | mochartConfig | The enhanced config produced by enhanceConfig (validated, defaults applied); null while the host is still loading it. |
dataProvider | DataProvider | null | dataProvider | The data source; use a built-in provider or any DataProvider implementation. Null while the host is still loading it. |
config | MochartInputConfig | config | The raw config; validated and enhanced internally on every change. |
data | ArrayOfObjectsData | ObjectOfArraysData | data | The dataset in either built-in shape — array of objects (one per category) or object of arrays (one per property); wrapped in the matching provider. |
Chart props
Sizing, container styling, state, and the controlled focus and filter props.
| Prop | Type | Core prop | Description |
|---|---|---|---|
width | number | width | Explicit pixel width; omit to track the host element's width. |
height | number | height | Explicit pixel height; omit to track the host element's height. |
loading | boolean | loading | Switches the chart into its loading state (see getLoadingComponent). |
error | unknown | error | Switches the chart into its error state when set to anything but null/undefined — '' and 0 count (see getErrorComponent). |
dataTestId | string | — | data-testid attribute applied to the host element, for test selectors. |
focusedCategoryIndex | number | focusedCategoryIndex | Controlled focused category index (-1 = none). When set it overrides the chart's internal focus on every update; pass back the value reported by focusChange to keep several charts in sync. Omit to leave focus chart-managed. |
focusedValueAxisId | string | null | focusedValueAxisId | Controlled focused value-axis id (null = none). See focusedCategoryIndex. |
focusedSeriesId | string | null | focusedSeriesId | Controlled focused series id (null = none); use the id of a series that does not set followSeries. See focusedCategoryIndex. |
filteredSeriesIds | Record<string, boolean> | filteredSeriesIds | Controlled filter map (series id → true = filtered out); pass back the map reported by seriesFilter to sync legend filtering across charts. Key it by series that do not set followSeries: a series that follows another filters with it. |
Callbacks
The chart callbacks, reporting the payloads documented in the core reference.
| Prop | Type | Core prop | Description |
|---|---|---|---|
chartClick | EventEmitter<ChartEventPayload> | onChartClick | The plot area was clicked. |
sliceClick | EventEmitter<ChartSliceClickPayload> | onSliceClick | A pie-type slice was clicked; fires only on click (unlike hover-driven onFocus), so it can anchor selection. |
seriesClick | EventEmitter<ChartSeriesClickPayload> | onSeriesClick | A cartesian series shape (bar, marker, label, line/area path) was clicked. Independent of focusOnClick; fires only on click, so it can anchor selection. |
chartMouseEnter | EventEmitter<ChartEventPayload> | onChartMouseEnter | The pointer entered the plot area. |
chartMouseMove | EventEmitter<ChartEventPayload> | onChartMouseMove | The pointer moved within the plot area. |
chartMouseLeave | EventEmitter<ChartEventPayload> | onChartMouseLeave | The pointer left the plot area. |
titleClick | EventEmitter<void> | onTitleClick | The chart title was clicked (see title.link/title.linkDisabled). |
focusChange | EventEmitter<ChartFocus> | onFocus | The focused series/category/value axis — via pointer over/click on the plot or the legend, per the focusOnHover/focusOnClick config. |
seriesFilter | EventEmitter<ChartSeriesFilter> | onSeriesFilter | A legend click toggled a series in or out of the filtered set (requires legend.filterOnClick). |
seriesLayoutBoundsChange | EventEmitter<Bounds> | onSeriesLayoutBoundsChange | The plot area was re-laid-out; reports its new bounds. |
State placeholders
What renders in each non-chart state, in place of the core state factories.
| Prop | Type | Core prop | Description |
|---|---|---|---|
loadingComponent | PlaceholderComponent | getLoadingComponent | Rendered while the loading prop is true. |
errorComponent | PlaceholderComponent | getErrorComponent | Rendered while the error prop is set. |
noDataComponent | PlaceholderComponent | getNoDataComponent | Rendered when the dataset has no categories. |
noSizeComponent | PlaceholderComponent | getNoSizeComponent | Rendered when width or height is not a positive number (0 before a container is laid out). |
noSeriesComponent | PlaceholderComponent | getNoSeriesComponent | Rendered when the config declares no series. |
configErrorComponent | PlaceholderComponent | getConfigErrorComponent | Rendered when the config fails validation. |