A volume as rounded bars on the left axis and a rate as a line on its own right axis, each with its own format, in a dashboard card.
Invoiced and margin
Bars on the left axis, a line on its own right axis, each with its own format. Hover or focus a month (arrow keys) to darken its bar and read both values; the tiles switch to that month.
Invoiced
$497,800
+24.7% vs the year before| Month | Invoiced | Margin |
|---|---|---|
| Jan | $29,400 | 31% |
| Feb | $33,400 | 34% |
| Mar | $31,600 | 29% |
| Apr | $38,400 | 36% |
| May | $38,000 | 38% |
| Jun | $44,200 | 41% |
| Jul | $40,800 | 37% |
| Aug | $35,700 | 33% |
| Sep | $47,400 | 42% |
| Oct | $51,200 | 44% |
| Nov | $50,900 | 43% |
| Dec | $56,800 | 47% |
- Invoiced · total$497,800
- Margin · average38%
Installation
Copies the component into src/design-system/ as your own source, with only the files it needs.
npx avesk-ui@latest add combo-chart-cardBrings the 8 files it builds on (chart.tsx, badge.tsx, dropdown-menu.tsx, button.tsx, glyph.tsx, icon.tsx, floating.tsx, segmented-control.tsx). The first time, it also adds the tokens and the cn() helper, imports the tokens in globals.css and installs clsx and tailwind-merge. Files already in your project are kept unless you add --force.
Import
Lives in src/design-system/components/combo-chart-card.tsx.
import { ComboChartCard } from "@/design-system/components/combo-chart-card";Usage
<ComboChartCard
title="Invoiced"
data={[{ label: "Jan", invoiced: 29400, margin: 0.31 }, …]}
bar={{ key: "invoiced", label: "Invoiced", format: (n) => formatMoney(n) }}
line={{ key: "margin", label: "Margin", format: (n) => formatPercent(n) }}
change={0.247}
/>Examples
Counts and a rate
Proposals sent as bars and the win rate as a line, with footer="legend" for a shorter card. A negative change shows in red.
Proposals sent
66
-12% vs the previous six months| Month | Sent | Win rate |
|---|---|---|
| May | 9 | 33% |
| Jun | 12 | 42% |
| Jul | 7 | 29% |
| Aug | 5 | 40% |
| Sep | 14 | 50% |
| Oct | 11 | 45% |
| Nov | 8 | 38% |
- Sent · total66
- Win rate · average40%
When to use
Use it when
- A count or amount and a rate over the same periods: invoiced and margin, proposals sent and win rate
- When both measures matter and one would flatten the other on a shared axis
Don’t use it when
- Several amounts in the same unit → Area chart card
- A single rate against a goal → Radial chart card
Rules
- Bars carry the volume, the line the rate; give each its own `format`
- Keep it to 6–12 periods so the bars stay readable
- Tiles show the bar total and the line average, and switch to the hovered period
Properties
ComboChartCard
| Prop | Type | Default |
|---|---|---|
title * | string | – |
data * | ChartRow[] | – |
bar * | ComboMeasure | – |
line * | ComboMeasure | – |
value | string | – |
change | number | – |
changeLabel | string | "vs previous period" |
invertChange | boolean | false |
period | ChartPeriod | – |
categoryLabel | string | "Period" |
footer | "tiles" | "legend" | "none" | "tiles" |
height | number | 196 |
headingLevel | 2 | 3 | 4 | 3 |
className | string | – |
* required
Accessibility
- The SVG has role="img" and an aria-label summary; a visually hidden table lists every value
- Every period or item is a focusable target with one Tab stop: arrows move, Home/End jump, Escape hides the tooltip; its aria-label reads the values
- The tooltip and headline follow hover and focus alike; meaning never relies on colour (labels and values sit next to every swatch)
- The draw-in animation only runs without prefers-reduced-motion