Flow · Basic

Funnel chart

How much drops at each stage, with conversion rates.

Open in playground
Use when
Ordered steps such as a sign-up or purchase flow
Avoid when
The steps have no order, or values grow from step to step

Try it

03

Funnel chart

Users by stage
Funnel chartFunnel chart. 4 steps: Visit 10,000, Product view 6,200 (62%), Cart 1,900 (31%), Purchase 760 (40%).vs. previousVisit10,000Product view6,20062%Cart1,90031%Purchase76040%
Funnel chart data
Visit10,000
Product view6,200 · 62% of previous step
Cart1,900 · 31% of previous step
Purchase760 · 40% of previous step
Drop-off by stageBasic

Hover over the chart, or Tab in and use the arrow keys to move between items. The numbers are sample data.

Variants

Named looks for this chart. Each one is the example above with a few options or fields changed. The CLI (ztd-charts example funnel --variant <id>) and the MCP server know the same names.

Rates from the first step

Users by stage
Sample data

Without rates

Users by stage
Sample data

Code

FunnelChart.tsx
import { ChartCard, FunnelChart } from "ztd-charts";

const data = [
  {"stage":"Visit","users":10000},
  {"stage":"Product view","users":6200},
  {"stage":"Cart","users":1900},
  {"stage":"Purchase","users":760},
];

export function Example() {
  return (
    <ChartCard number="03" title="Funnel chart" subtitle="Users by stage" takeaway="Drop-off by stage" level="basic" replay>
      <FunnelChart
        data={data}
        label="stage"
        value="users"
      />
    </ChartCard>
  );
}

Props

<FunnelChart> takes these props. Rows marked Common work the same on every chart.

27 props

Prop
dataRequiredAn array of objects. Pass CSV, REST or database rows as they areobject[]
labelRequiredStage namestring | (d, i) => string
valueRequiredUsers at the stagestring | (d, i) => number
showRatesShow conversion rates on the rightbooleanDefault true
rateBaseBase for the conversion rate"previous" | "first"Default "previous"
rateLabelTitle of the rate column. "전 단계 대비" by default in Korean localesstringDefault "vs. previous"
heightCommonHeight in px. Without it, each chart picks a default that fits its widthnumber
widthCommonFixed width in px. Without it, the chart fits its parentnumber
highlightCommonItem to highlight. An index, a name, an array, or "max" | "min" | "first" | "last" | "none"number | string | (number|string)[] | "max" …
formatCommonValue format. "number" | "integer" | "percent" (values are already percents: 42 → "42%") | "ratio" (0.42 → "42%") | "compact" | "currency" (KRW for Korean locales, otherwise USD; for another currency pass Intl options with currency) | "decimal" or Intl.NumberFormat options"number" | "percent" | "compact" | …
unitCommonUnit appended to values. For example "%" or "ms"string
localeCommonLocale for numbers, dates and the text a chart writes itself (tooltips, screen reader sentences). "ko" or "ko-*" switches to Korean. Falls back to the ThemeProvider localestringDefault "en-US"
animateCommonEntry and update animationbooleanDefault true
durationCommonAnimation length (ms)number
easingCommonMotion curve"spring" | "easeOut" | "easeInOut" | "linear"Default "spring"
staggerCommonDelay between items as they enter (ms)number
reducedMotionCommon"auto" follows the OS setting. true always turns motion offanyDefault "auto"
animateOnViewCommonPlay when the chart scrolls into viewbooleanDefault true
showLabelsCommonLabels drawn on the chart (values and names)booleanDefault true
tooltipCommonShow tooltips. { template: "{label} · {value} · owner {owner}" } writes them: {label}, {value}, {series} or any other column of the row. \n starts a new line, and a line with an empty value is left outtooltipDefault true
syncIdCommonCharts with the same syncId show the hovered x together (line, area, bar, candlestick). <ChartGrid sync> sets one for every chart inside itstring
ariaLabelCommonName for screen readersstring
descriptionCommonDescription for screen readers. Built from the data when omittedstring
onHoverCommonRuns when hover or keyboard focus moves to another item(e: ChartEvent | null) => void
onClickCommonRuns on click, Enter or Space(e: ChartEvent) => void
replayKeyCommonReplays the entry animation when it changesstring | number
themeCommonChanges theme tokens for this chart onlyPartial<ChartTheme>