Skip to content
EspañolEnglish
All components (283)

Combo chart

Data · ComboChart

What it is and when to use it

Bars and lines in the same drawing, each series on its own axis if needed: invoiced in bars and margin in a line. It is the chart of a financial dashboard, and it crosses two measures of different scale without making two charts.

The drawing is the decoration and the table is the data: underneath goes a real table (one row per category, one column per series), hidden from view unless tableVisible.

When to use it

  • A quantity and a percentage over the same period: sales and margin, orders and return rate.
  • A measure and its reference: actuals in bars and forecast in a line.
  • Each series states its type (bar, by default, or line) and its axis (start, by default, or end). The right axis only appears if some series asks for it.
  • format writes the left axis and formatEnd the right one. min, max, minEnd and maxEnd fix each scale.
  • loading and error say so in the place of the drawing, with the same height, so the page does not jump when the data arrives.
  • renderTooltip paints the tooltip of each category your way, with the value of each series already written with the format of its axis. animated (the default) animates the entrance and the change of data.

When not to

  • Series of the same unit that just evolve: LineChart.
  • The total and what it is made of: StackedBarChart.
  • Two measures without a common period, to see whether they go together: ScatterChart.

Keyboard: Tab takes you to the drawing (a single tab stop) and the arrows move from point to point; up and down change series, Home and End go to the first and last, and Escape leaves. A spoken notice says each point. With onPointPress, each value in the tooltip is a button.

Accessibility: the drawing is an image (role="img") with a written summary of each series, in the format of its axis. Series are also told apart without colour: the line's stroke, the point's shape and the bar's pattern. In forced contrast they take system colours.

Fine look: the --amset-series-* CSS variables of the other series charts: -axis, -bar, -cap, -footer, -height, -label, -stroke.

What it looks like

Use the arrow keys to move through the values, Home and End to jump to the first and last, and Escape to leave.
  • Invoiced
  • Margin
Invoiced and margin in 2026
MonthInvoicedMargin
Jan4200 €18 %
Feb3900 €16 %
Tue5100 €21 %
Apr6400 €24 %
May6100 €22 %
Jun7300 €27 %
Jul6900 €26 %
Aug5200 €
Sep7800 €29 %

<ComboChart
  label="Invoiced and margin in 2026"
  categories={meses}
  series={[
    { key: "facturado", label: "Invoiced", type: "bar", values: facturado },
    { key: "margen", label: "Margin", type: "line", axis: "end", tone: "warning", values: margen },
  ]}
  format={enEuros}
  formatEnd={enPorcentaje}
  categoryName="Month"
/>

Props

Import it with import { ComboChart } from '@amset/ui'. Required props are marked.

PropTypeWhat it does
categoriesrequiredreadonly string[]What goes on the bottom axis: the months, the days. One per value of each series.
labelrequiredstringWhat is being measured. Required: a chart without a title does not inform.
seriesrequiredreadonly ComboChartSeries[]The series, each with its `type` (`bar` or `line`) and its `axis` (`start` or `end`).
animatedbooleanAnimates the drawing on entry and when the data change, as in the rest of the series charts. `true` by default.
categoryNamestringWhat the first column of the table is called. By default, "Period".
classNamestringMerged with the library classes; it does not replace them.
errorReactNodeThe data has not arrived: it says so in the place of the drawing, with what is passed here.
format(value: number) => stringHow a value of the left axis is written.
formatEnd(value: number) => stringHow a value of the right axis is written. Without this, the same as the left one.
heightnumberHeight of the drawing in pixels. By default, that of the size.
hiddenSeriesreadonly string[]The keys of the hidden series, when the chart's user keeps them. Without it, the chart keeps them itself.
legendbooleanThe legend with the name of each series. By default, only if there is more than one.
loadingbooleanThe data is on its way: a notice appears in the place of the drawing, and the page does not jump when it arrives.
maxnumber—
maxEndnumber—
minnumberMinimum and maximum of the left axis, by hand.
minEndnumberMinimum and maximum of the right axis, by hand.
onHiddenSeriesChange(hidden: readonly string[]) => voidCalled with the hidden keys after a legend entry is pressed.
onPointPress(point: ChartPoint) => voidMakes every value pressable (in the tooltip of its category, also by keyboard and touch) and hands over the pressed point.
referenceBandsreadonly ChartReferenceBand[]Horizontal reference bands, measured on the left axis.
referenceLinesreadonly ChartReferenceLine[]Horizontal reference lines, measured on the left axis.
renderTooltip(info: ChartTooltipInfo) => ReactNodePaints the tooltip of each category instead of the built-in one: it receives its rows already written with the format of each axis.
size"sm" | "md" | "lg"—
tableVisiblebooleanAlso shows the table. For the screen reader it is always there.
toggleSeriesbooleanThe legend stops being a label and each entry becomes a button that hides or brings back its series.

It also accepts the attributes of the element it renders: className, style, data-*, aria-* and its events.

In the test bench

Every state and variant, to try one at a time, on its page at storybook.amsetui.com: