Totals over time and what makes them up, stacked or as shares of 100%.
| Month | Existing | Expansion | New |
|---|---|---|---|
| December 2025 | $185,797 | $22,206 | $14,532 |
| January 2026 | $191,209 | $22,905 | $15,650 |
| February 2026 | $195,479 | $23,628 | $14,883 |
| March 2026 | $201,305 | $25,027 | $15,255 |
| April 2026 | $206,020 | $26,189 | $15,817 |
| May 2026 | $211,651 | $27,587 | $15,926 |
| June 2026 | $216,665 | $29,120 | $15,894 |
| July 2026 | $221,816 | $30,074 | $16,845 |
| August 2026 | $228,030 | $31,299 | $16,316 |
| September 2026 | $234,821 | $32,353 | $16,525 |
| October 2026 | $240,333 | $33,428 | $15,835 |
| November 2026 | $246,452 | $35,206 | $15,099 |
import type { Html } from "@effect/ui/html"import { Chart } from "./ui/uicontext/components/charts/Chart.ts"import { mrr } from "./metrics.ts"// Monthly recurring revenue and what it's made of. The tooltip lists each source and the total.export const RevenueArea = <M>(h: Html.H<M>) => Chart(h, { props: { type: "area", stacked: "stacked", label: "Monthly recurring revenue by source", series: mrr, x: { kind: "time", unit: "month", label: "Month" }, format: { style: "currency", currency: "USD", digits: 0 }, height: 260, }, onEmit: { Highlighted: () => undefined, Selected: () => undefined, Toggled: () => undefined, RequestedRetry: () => undefined }, })Installation
pnpm dlx shadcn@latest add checkfu/uicontext/area-chartUsage
import { Chart } from "./ui/uicontext/components/charts/Chart.ts"import type { ChartSeries } from "./ui/uicontext/components/charts/Data.ts"export const RevenueArea = <M>(h: Html.H<M>, series: ReadonlyArray<ChartSeries>) => Chart(h, { props: { type: "area", stacked: "stacked", label: "Monthly recurring revenue by source", series, x: { kind: "time", unit: "month" }, format: { style: "currency", currency: "USD", digits: 0 }, }, onEmit: { Highlighted: () => undefined, Selected: () => undefined, Toggled: () => undefined, RequestedRetry: () => undefined }, })Examples
Controlled
The page owns the hidden series and hears hover and clicks.
| Date | Expansion | New |
|---|---|---|
| December 2025 | $22,206 | $14,532 |
| January 2026 | $22,905 | $15,650 |
| February 2026 | $23,628 | $14,883 |
| March 2026 | $25,027 | $15,255 |
| April 2026 | $26,189 | $15,817 |
| May 2026 | $27,587 | $15,926 |
| June 2026 | $29,120 | $15,894 |
| July 2026 | $30,074 | $16,845 |
| August 2026 | $31,299 | $16,316 |
| September 2026 | $32,353 | $16,525 |
| October 2026 | $33,428 | $15,835 |
| November 2026 | $35,206 | $15,099 |
Hidden: Existing.
import { UiSchema } from "@effect/ui"import { Html } from "@effect/ui/html"import * as stylex from "@stylexjs/stylex"import { Schema } from "effect"import { Chart } from "./ui/uicontext/components/charts/Chart.ts"import { ChartX } from "./ui/uicontext/components/charts/Data.ts"import { formatTime } from "./ui/uicontext/components/charts/Format.ts"import { sx } from "./ui/uicontext/components/Sx.ts"import { color, font, space } from "./ui/uicontext/components/tokens.stylex.ts"import { mrr } from "./metrics.ts"const styles = stylex.create({ root: { display: "grid", gap: space.md, inlineSize: "100%" }, note: { margin: 0, minBlockSize: "1.5em", color: color.muted, fontSize: font.sm, fontVariantNumeric: "tabular-nums" },})const Message = UiSchema.TaggedEnum({ ToggledRevenueSeries: { id: Schema.String, hidden: Schema.Boolean }, HighlightedRevenueMonth: { x: Schema.NullOr(ChartX) }, SelectedRevenueMonth: { x: ChartX },})// The page owns which sources are hidden, so they can live in the URL, and hears which month is read// and which one was clicked.export const ControlledRevenue = Html.component({ name: "ControlledRevenue", model: Schema.Struct({ hidden: Schema.Array(Schema.String), reading: Schema.NullOr(ChartX), picked: Schema.NullOr(ChartX) }), message: Message,}).make({ init: () => ({ hidden: ["existing"], reading: null, picked: null }), update: { ToggledRevenueSeries: ($, { id, hidden }) => $.evolve({ hidden: (ids) => (hidden ? [...ids, id] : ids.filter((i) => i !== id)) }), HighlightedRevenueMonth: ($, { x }) => $.evolve({ reading: x }), SelectedRevenueMonth: ($, { x }) => $.evolve({ picked: x }), }, view: (h, model) => h.div.attrs(sx(styles.root)).children( Chart(h, { props: { type: "area", stacked: "stacked", label: "Recurring revenue by source", series: mrr, hidden: model.hidden, x: { kind: "time", unit: "month" }, format: { style: "currency", currency: "USD", digits: 0 }, }, onEmit: { Toggled: ({ id, hidden }) => Message.ToggledRevenueSeries({ id, hidden }), Highlighted: ({ x }) => Message.HighlightedRevenueMonth({ x }), Selected: ({ x }) => Message.SelectedRevenueMonth({ x }), RequestedRetry: () => undefined, }, }), h.p.attrs(sx(styles.note)).children( model.picked !== null ? `Opened the report for ${formatTime(Date.parse(`${model.picked}T00:00:00Z`), "month")}.` : model.reading !== null ? `Reading ${formatTime(Date.parse(`${model.reading}T00:00:00Z`), "month")}. Click to open its report.` : `Hidden: ${model.hidden.length === 0 ? "nothing" : model.hidden.map((id) => mrr.find((s) => s.id === id)?.label ?? id).join(", ")}.`, ), ),})Share of 100%
Stacked as percentages, smoothed. Hide a plan and the rest fill the whole again.
| Week of | Free | Pro | Team | Enterprise |
|---|---|---|---|---|
| Sep 7, 2026 | 409 | 154 | 70 | 9 |
| Sep 14, 2026 | 407 | 167 | 72 | 9 |
| Sep 21, 2026 | 420 | 165 | 79 | 9 |
| Sep 28, 2026 | 430 | 163 | 80 | 10 |
| Oct 5, 2026 | 455 | 161 | 78 | 10 |
| Oct 12, 2026 | 491 | 171 | 79 | 10 |
| Oct 19, 2026 | 479 | 169 | 88 | 11 |
| Oct 26, 2026 | 507 | 161 | 94 | 12 |
| Nov 2, 2026 | 490 | 165 | 99 | 13 |
| Nov 9, 2026 | 536 | 170 | 101 | 13 |
| Nov 16, 2026 | 521 | 186 | 100 | 13 |
| Nov 23, 2026 | 530 | 205 | 111 | 13 |
import type { Html } from "@effect/ui/html"import { Chart } from "./ui/uicontext/components/charts/Chart.ts"import { signupsByPlan } from "./metrics.ts"// Each week's signups as shares of 100%, to see the mix shift toward paid plans. The tooltip keeps// the counts beside each share.export const SignupMix = <M>(h: Html.H<M>) => Chart(h, { props: { type: "area", stacked: "percent", label: "Signups by plan, share of each week", series: signupsByPlan, x: { kind: "time", unit: "week", label: "Week of" }, curve: "smooth", }, 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
- The arrow keys step through each x and announce every series and the total; percent stacks read each share with its count.
- The hidden table lists every value, and View as table shows it.