Config reference
The reference has three parts:
- Config sections — this page and the pages it links to, one per section of a mochart config (
chart,series,categoryAxis, …): every property, its rules, and its default. Generated from the library source — the same descriptions, validators, and defaults that power config validation produce these pages, so they cannot drift from the code. - Props and callbacks — what a chart instance takes, as opposed to what its config says: Chart props (sizing,
loading/error, controlled focus and filtering, the state factories), Callbacks and payloads, and the name each framework binding gives those props in Framework props. Generated from the packages' type declarations. - API — the functions and classes
@mochart/coreexports: the entry points andChartHandle, the data providers, the config and chart helpers, constants, andmochartCssClasses. The literal types behind the enumerated config values (RendererType,CurveType, …) have their own generated page, Enumerated values.
Config sections
A mochart config is a plain object made of per-concern sections. Every section — and almost every property inside one — is optional and falls back to a sensible default, so a minimal config only names the data properties to plot (see Getting started).
The list sections (series, valueAxes, seriesGroups, seriesStacks, linearGradients, radialGradients, patterns) take an array of config objects and have a companion *Defaults section for values shared by every entry — see The config model for how sharing and defaulting work. id and version are the only top-level keys that are not sections.
| Property | Description | Default |
|---|---|---|
accessibility | Configure the chart accessibility features and screen-reader labels | {} |
animation | Configure the chart animation settings | {} |
categoryAxis | Configure the chart category axis content and styling | {} |
chart | Configure general settings of the chart | {} |
clipIndicator | Configure the band marking plot edges that have data hidden behind them (applies when chart.type is xy) | {} |
colorPalette | Configure the color palettes to use for collections of series | {} |
crosshair | Configure the crosshair styling and behavior when a category and/or series is focused (applies when chart.type is xy) | {} |
id | An optional identifier for the config (any value; the chart only compares it — a changed id resets the chart) | |
legend | Configure the chart legend which itemizes the series | {} |
linearGradientslinearGradientDefaults | Configure linear gradients to be applied to series Configure common properties for all linear gradients | [] |
patternspatternDefaults | Configure built-in patterns to be applied to series fills Configure common properties for all patterns | [] |
pie | Configure the pie/donut slice geometry and slice labels (applies when chart.type is pie) | {} |
plot | Configure the chart plot content and styling | {} |
radialGradientsradialGradientDefaults | Configure radial gradients to be applied to series Configure common properties for all radial gradients | [] |
seriesseriesDefaults | Configure the chart series Configure common properties for all series | [] |
seriesGroupsseriesGroupDefaults | Configure the grouping of series Configure common properties for all series groups | [] |
seriesStacksseriesStackDefaults | Configure the stacking of series Configure common properties for all series stacks | [] |
title | Configure the chart title | {} |
tooltip | Configure the chart tooltip styling and behavior | {} |
valueAxesvalueAxisDefaults | Configure the chart value axes content and styling Configure common properties for all value axes | [] |
version | The version of the configuration format (optional: omitted means the current format; include it in stored or shared configs so future releases can migrate them) |