Skip to main content

Chart Mode Config

modeConfig.chart controls series definitions, axes, grid, legends, tooltips, and orientation in chart mode.

content: {
mode: 'chart',
modeConfig: {
chart: {
xAxis: 'month',
height: 300,
showLegend: true,
series: [
{ key: 'revenue', type: 'bar' },
{ key: 'visits', type: 'line' },
],
},
},
item: { fields: […], layout: { type: 'auto' } },
},

Options​

OptionValuesDefaultEffect
xAxisstring'name'Selects the label field used for chart categories.
heightnumber300Sets the chart height in pixels.
showLegendtrue, falsetrueShows or hides the legend.
legendAlignleft, center, rightcenterAligns the legend.
showGridtrue, falsetrueShows or hides the cartesian grid.
showLabelstrue, falsefalseShows or hides data labels on bars, lines, and polar segments.
colorsstring arraytheme tokensOverrides the default series color palette.
orientationvertical, horizontalverticalFlips bar charts to horizontal. Only applies when all series are bar.
lineThicknessnumber (0.5–20)3.5Sets the default stroke width for line and area series. Can be overridden per series.
showDotstrue, falsefalseShows or hides line/area data points. Can be overridden per series.
areaGradienttrue, falsetrueEnables or disables gradient fills for area series. Can be overridden per series.
showTooltiptrue, falsetrueEnables or disables hover tooltips.
donutInnerRadiusRationumber (0.2–0.9)0.58Controls the donut hole size. Can be overridden per series.
tooltip.positiontop, bottom, left, right, top-right, top-left, bottom-right, bottom-lefttop-rightSets tooltip placement.
tooltip.render(context) => ReactNodeunsetReplaces the built-in tooltip content.

Per-series overrides​

color, lineThickness, showDots, areaGradient, and donutInnerRadiusRatio can be set on individual series entries to override the chart-level default for that series only:

chart: {
showDots: false, // default for all series
lineThickness: 1.5,
series: [
{ key: 'revenue', type: 'line', showDots: true, color: '#6366f1', lineThickness: 3 }, // overrides
{ key: 'visits', type: 'line' }, // inherits chart defaults
],
}

Mode-Specific Caveats​

  • orientation applies only when all series are bar.
  • donutInnerRadiusRatio applies only to donut series.
  • Only one pie or donut series is supported per chart.
  • Mixing polar (pie, donut) and cartesian (bar, line, area) series in the same chart is not supported.
  • Sorting (config.sorting) is not supported in chart mode. Pre-sort your data before passing it in if a specific order is needed.

Coverage Summary​

Every chart option is mapped to at least one example or subsection on the Chart Mode guide page:

  • xAxis, height, showLegend, showGrid: Bar Chart, Line Chart, Area Chart, Pie Chart, Donut Chart
  • legendAlign, showLabels, colors, showTooltip, tooltip.position, tooltip.render: Chart Options Reference
  • orientation: Horizontal Bars example
  • lineThickness, showDots, areaGradient: Per-Series Overrides, Line/Area Chart
  • donutInnerRadiusRatio: Donut Chart, Per-Series Overrides

See Also​