Skip to content

Config Reference

Looking for something other than config? The functions and classes are in the API reference; the props each chart accepts are in Chart props and Callbacks and payloads; and what the framework bindings call those props is in Framework props.

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).

This reference is 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.

The list sections (series, valueAxes, gradients, groups, stacks) 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.

PropertyDescriptionDefault
accessibilityConfigure the chart accessibility features and screen-reader labels {}
animationConfigure the chart animation settings {}
categoryAxisConfigure the chart category axis content and styling {}
chartConfigure general settings of the chart {}
colorPaletteConfigure the color palettes to use for collections of series {}
crosshairConfigure the crosshair styling and behavior when a category and/or series is focused {}
idAn optional identifier for the config (any value; the chart only compares it — a changed id resets the chart)
legendConfigure the chart legend which itemizes the series {}
linearGradients
linearGradientDefaults
Configure linear gradients to be applied to series
Configure common properties for all linear gradients
[]
pieConfigure the pie/donut slice geometry and slice labels (applies when chart.type is pie) {}
plotConfigure the chart plot content and styling {}
radialGradients
radialGradientDefaults
Configure radial gradients to be applied to series
Configure common properties for all radial gradients
[]
series
seriesDefaults
Configure the chart series
Configure common properties for all series
[]
seriesGroups
seriesGroupDefaults
Configure the grouping of series
Configure common properties for all series groups
[]
seriesStacks
seriesStackDefaults
Configure the stacking of series
Configure common properties for all series stacks
[]
titleConfigure the chart title {}
tooltipConfigure the chart tooltip styling and behavior {}
valueAxes
valueAxisDefaults
Configure the chart value axes content and styling
Configure common properties for all value axes
[]
versionThe version of the configuration format (optional: omitted means the current format; include it in stored or shared configs so future releases can migrate them)

Released under the BSD-3-Clause License.