Bars and a line on one time axis, each read against its own scale.
| Week of | Revenue | Paying customers |
|---|---|---|
| Sep 21, 2026 | $40,617 | 3,854 |
| Sep 28, 2026 | $39,639 | 3,909 |
| Oct 5, 2026 | $41,053 | 3,950 |
| Oct 12, 2026 | $40,391 | 3,989 |
| Oct 19, 2026 | $40,874 | 4,046 |
| Oct 26, 2026 | $42,894 | 4,080 |
| Nov 2, 2026 | $43,055 | 4,126 |
| Nov 9, 2026 | $42,013 | 4,168 |
| Nov 16, 2026 | $44,008 | 4,206 |
| Nov 23, 2026 | $43,388 | 4,267 |
import type { Html } from "@effect/ui/html"import { Chart } from "./ui/uicontext/components/charts/Chart.ts"import { revenueAndCustomers } from "./metrics.ts"// Weekly revenue as bars, read on the left, and paying customers as a line, read on the right. Each// axis is titled with what it measures, and both share gridlines.export const RevenueAndCustomers = <M>(h: Html.H<M>) => Chart(h, { props: { type: "combo", label: "Weekly revenue and paying customers", series: revenueAndCustomers, x: { kind: "time", unit: "week", label: "Week of" }, format: { style: "currency", currency: "USD", digits: 0 }, endFormat: { style: "number" }, // the customer line reads against its own range; the bars still start at zero zero: false, height: 260, }, onEmit: { Highlighted: () => undefined, Selected: () => undefined, Toggled: () => undefined, RequestedRetry: () => undefined }, })Installation
pnpm dlx shadcn@latest add checkfu/uicontext/combo-chartUsage
import { Chart } from "./ui/uicontext/components/charts/Chart.ts"import type { ChartSeries } from "./ui/uicontext/components/charts/Data.ts"export const RevenueAndCustomers = <M>(h: Html.H<M>, series: ReadonlyArray<ChartSeries>) => Chart(h, { props: { type: "combo", label: "Weekly revenue and paying customers", series, x: { kind: "time", unit: "week" }, format: { style: "currency", currency: "USD", digits: 0 }, endFormat: { style: "number" }, }, onEmit: { Highlighted: () => undefined, Selected: () => undefined, Toggled: () => undefined, RequestedRetry: () => undefined }, })API reference
Props
| Name | Type | Default | Description |
|---|---|---|---|
typerequired | ChartType | — | — |
labelrequired | string | — | What the chart shows, for screen readers and the table's caption: "Monthly recurring revenue" |
seriesrequired | ChartSeries[] | — | — |
x | ChartXAxis | — | The x axis: categories in the order given (the default), or time |
format | ChartFormat | — | How values read; a series' own format wins for it |
endFormat | ChartFormat | — | A combo chart's end axis format |
stacked | "none" | "stacked" | "percent" | — | Stack areas or bars; percent shows each x as shares of 100% |
horizontal | boolean | — | Bars run sideways, categories down the side: for long names or ranked lists |
curve | "linear" | "smooth" | "step" | — | — |
markers | boolean | — | A dot on every point, when there's room for them |
zero | boolean | True | Start the value axis at zero; bars and areas always do. True by default |
height | number | 240 | The plot's height in pixels, axes included; 240 by default |
hidden | string[] | — | Series ids to hide. Leave it out and the chart keeps track itself; pass it to own it |
legend | boolean | — | False hides the legend; it shows by default for two or more series |
tableToggle | boolean | — | False drops the View as table button; the hidden table for screen readers stays |
status | ChartStatus | — | — |
error | string | — | What went wrong, said plainly, under "Couldn't load this chart." |
empty | string | — | What an empty chart says: "No deploys in this period." |
locale | string | — | — |
Events
| Event | Payload | Description |
|---|---|---|
Highlighted | { x: ChartX | null } | The x being read changed, by pointer or keyboard; null when reading stops |
Selected | { x: ChartX } | A click, a tap or Enter on a point |
Toggled | { id: string; hidden: boolean } | The legend asked to hide or show a series |
RequestedRetry | {} | — |
Accessibility
- Each axis is titled with the series it measures, and every value is announced in its own format as the arrow keys move.