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
titlestring—Title text for the component.
descriptionstring—Supporting description text.
secondAxisbooleanfalseRender line on a secondary right y-axis
widthnumber—Fixed 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.
tooltipboolean—Enable hover/keyboard tooltip
classNamestring—Additional 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) => string—Format each X-axis tick label.
legendboolean—Show the legend.
lineLabelstring'Line'Legend label for the line series.
xLabelEverynumber—Render 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