ComboChart

Combination bar + line chart on shared or dual y-axes.

Category: chart · WCAG 2.1-AA · chart, combo, bar, line, dual-axis, data-viz

Props

PropTypeDefaultDescription
bars{ label: string; value: number }[]Bar series data
line{ x: number; y: number }[]Line series data points
titlestringTitle text for the component.
descriptionstringSupporting description text.
secondAxisbooleanfalseRender line on a secondary right y-axis
widthnumberFixed SVG width in px. ⚠ **Omit for a responsive chart** — the chart fills and tracks its container via a ResizeObserver; there is no correct pixel number in a responsive grid. A fixed width is clamped to the container (max-inline-size: 100%) so it can never overflow its card, but it also stops the chart growing. `useChartSize` is NOT needed for this — charts call it internally.
heightnumber320SVG height in px. Unlike `width`, height does NOT track the container — this is the knob you set to change the chart's aspect.
tooltipbooleanEnable hover/keyboard tooltip
classNamestringAdditional CSS class names merged onto the root element.
plainbooleanfalseMarks only — no axes, grid lines, or legend. For micro/inline charts.
annotationsAnnotation[]Reference lines, shaded bands, and markers drawn over the plot (e.g. a target/threshold line).
barsLabelstring'Bars'Legend label for the bar series.
format(value: number | string | Date) => stringFormat each X-axis tick label.
legendbooleanShow the legend.
lineLabelstring'Line'Legend label for the line series.
xLabelEverynumberRender every Nth category label.

Design tokens

When to use

When not to use

Examples

Basic combo chart

import { ComboChart } from '@cascivo/charts'

const bars = [{label:'Jan',value:100},{label:'Feb',value:120},{label:'Mar',value:90}]
const line = [{x:0,y:50},{x:1,y:70},{x:2,y:60}]
<ComboChart bars={bars} line={line} title="Sales vs Target" />

Related components

← Back to docs