Funnel chart
Shows how many remain at each step of a sequence, with conversion and drop-off between steps.
- Use when
- A strict sequence where each stage is a subset of the one before: sign-up flows, hiring pipelines, sales stages, applications to admissions. 3 to 7 stages.
- Avoid when
- Stages that are not sequential subsets, or categories with no order (use bar chart); flows that split to several destinations (use sankey chart); conversion tracked over time (use line chart).
Preview
20% of pricing-page visitors started a free trial
Users reaching each step of the sign-up funnel, last 90 days
import { FunnelChart } from "insightcharts";
const data = [
{ step: "Visited the pricing page", users: 48200 },
{ step: "Started a free trial", users: 9640 },
{ step: "Connected a data source", users: 5310 },
{ step: "Invited a teammate", users: 2230 },
{ step: "Became a paying customer", users: 1480 },
];
export function Example() {
return (
<FunnelChart
data={data}
stage="step"
value="users"
format="integer"
title="20% of pricing-page visitors started a free trial"
subtitle="Users reaching each step of the sign-up funnel, last 90 days"
source="Product analytics"
note="Illustrative data"
/>
);
}{
"type": "funnel-chart",
"data": [
{ "step": "Visited the pricing page", "users": 48200 },
{ "step": "Started a free trial", "users": 9640 },
{ "step": "Connected a data source", "users": 5310 },
{ "step": "Invited a teammate", "users": 2230 },
{ "step": "Became a paying customer", "users": 1480 }
],
"stage": "step",
"value": "users",
"format": "integer",
"title": "20% of pricing-page visitors started a free trial",
"subtitle": "Users reaching each step of the sign-up funnel, last 90 days",
"source": "Product analytics",
"note": "Illustrative data"
}Render with import { Insight } from "insightcharts" and <Insight spec={spec} />. Nested specs resolve by name; nothing else to import.
Composition
Used in
No molecule or template lists funnel chart in its composes. It still fits any slot that takes a component.
Installation
$ pnpm dlx shadcn@latest add @insightcharts/funnel-chartThe CLI copies the source into your project and needs the @insightcharts registry in components.json; see installation. With the package, import it by name:
import { FunnelChart } from "insightcharts";Examples
Three stages, highlight
930 of 12,400 applicants were offered a place
Applications to the graduate scheme, 2024 intake
import { FunnelChart } from "insightcharts";
const data = [
{ stage: "Applied", people: 12400 },
{ stage: "Interviewed", people: 1860 },
{ stage: "Offered a place", people: 930 },
];
export function Example() {
return (
<FunnelChart
data={data}
stage="stage"
value="people"
highlight="Offered a place"
dropoffLabel="rejected"
height={220}
title="930 of 12,400 applicants were offered a place"
subtitle="Applications to the graduate scheme, 2024 intake"
source="HR recruitment data"
note="Illustrative data"
/>
);
}{
"type": "funnel-chart",
"data": [
{ "stage": "Applied", "people": 12400 },
{ "stage": "Interviewed", "people": 1860 },
{ "stage": "Offered a place", "people": 930 }
],
"stage": "stage",
"value": "people",
"highlight": "Offered a place",
"dropoffLabel": "rejected",
"height": 220,
"title": "930 of 12,400 applicants were offered a place",
"subtitle": "Applications to the graduate scheme, 2024 intake",
"source": "HR recruitment data",
"note": "Illustrative data"
}Render with import { Insight } from "insightcharts" and <Insight spec={spec} />. Nested specs resolve by name; nothing else to import.
Stress: seven stages, long names, big numbers
12% of ad impressions led to a click
Campaign funnel from ad impression to purchase, fourth quarter
import { FunnelChart } from "insightcharts";
const data = [
{ stage: "Impressions served across all paid channels", n: 18400000 },
{ stage: "Clicked through to the landing page", n: 2210000 },
{ stage: "Viewed at least one product", n: 1480000 },
{ stage: "Added an item to the basket", n: 412000 },
{ stage: "Reached checkout", n: 236000 },
{ stage: "Entered payment details", n: 171000 },
{ stage: "Completed purchase", n: 148000 },
];
export function Example() {
return (
<FunnelChart
data={data}
stage="stage"
value="n"
format="compact"
height={420}
title="12% of ad impressions led to a click"
subtitle="Campaign funnel from ad impression to purchase, fourth quarter"
source="Marketing analytics"
note="Illustrative data"
/>
);
}{
"type": "funnel-chart",
"data": [
{ "stage": "Impressions served across all paid channels", "n": 18400000 },
{ "stage": "Clicked through to the landing page", "n": 2210000 },
{ "stage": "Viewed at least one product", "n": 1480000 },
{ "stage": "Added an item to the basket", "n": 412000 },
{ "stage": "Reached checkout", "n": 236000 },
{ "stage": "Entered payment details", "n": 171000 },
{ "stage": "Completed purchase", "n": 148000 }
],
"stage": "stage",
"value": "n",
"format": "compact",
"height": 420,
"title": "12% of ad impressions led to a click",
"subtitle": "Campaign funnel from ad impression to purchase, fourth quarter",
"source": "Marketing analytics",
"note": "Illustrative data"
}Render with import { Insight } from "insightcharts" and <Insight spec={spec} />. Nested specs resolve by name; nothing else to import.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| stagerequired | string | Stage field. Rows are read in data order; the first row is the top of the funnel. | |
| valuerequired | string | Count field. | |
| dropoff | boolean | true | State the drop-off between consecutive stages. |
| dropoffLabel | string | "dropped off" | Word for what is lost between stages. |
Common chart props 29
Every chart built with defineChart accepts these on top of its own props.
| Prop | Type | Description |
|---|---|---|
| data | DataInput | Rows, CSV text, a URL, { url, path }, an async function, or an Arrow-style table. Omit inside <InsightData>. |
| transform | Transform | Transform[] | A pipeline of transforms applied before drawing. |
| title | string | The title. One plain statement of what the data shows, with the number and the period ("Monthly churn fell from 4.2% to 2.1% in 2024"), or a plain label ("Monthly churn, 2024"). One clause, no figures of speech. |
| subtitle | string | Measure, unit, population, period. |
| source | string | Data source, shown as "Source: ...". |
| note | string | Method notes or caveats. |
| height | number | string | CSS height of the plot. Default 360. |
| aspect | number | Width / height. Overrides height. |
| highlight | string | string[] | The entity (or entities) the title is about. Every other series is drawn in grey. |
| annotations | Annotation[] | Reference lines, shaded bands and callouts, in data coordinates. |
| format | FormatSpec | How to print values: "compact", "percent", "currency:USD", "{value} kg", Intl options, or a function. |
| legend | boolean | Show the legend. Default: shown when there are two or more series. |
| select | boolean | string | Make marks clickable to filter. Inside <InsightData> the selection filters every other chart. Pass a field name, or true to use the chart's category field. |
| onSelect | (values: string[], field: string) => void | Called with the selected values whenever the selection changes. |
| option | EChartsOption | ((option: EChartsOption, ctx: BuildContext) => EChartsOption) | Deep-merged over the generated ECharts option, or a function that receives and returns it. Use it for ECharts settings no prop covers. |
| theme | ThemeInput | A theme, or a partial set of tokens merged over the surrounding theme, for this chart only. |
| mode | ModeInput | "auto" (default) follows the page, "system" follows the OS, or force "light" / "dark". |
| renderer | RendererInput | "auto" (default) uses SVG for light charts and canvas for heavy ones. |
| animate | boolean | Set false to disable animation. Reduced-motion preferences are always respected. |
| lazy | boolean | Mount the chart only when it scrolls near the viewport. Default true. |
| group | string | Link tooltips with other charts sharing this group id. |
| exportable | boolean | ExportFormat[] | Show an export menu: true or a list of formats from png, jpeg, svg, pdf, csv, json. |
| table | boolean | Show a collapsible "View data" table under the chart. |
| alt | string | Accessible description: the chart type and measures, then the main pattern and the notable values. |
| id | string | Stable id for this chart's selection in the shared store. |
| onEvents | Record<string, ChartEventHandler> | ECharts event handlers, e.g. { click: (params, chart) => {} }. Prefix a name with zr: to bind to the canvas itself. |
| onReady | (chart: EChartsInstance) => void | Called with the ECharts instance once it is created. |
| className | string | Class name for the outer <figure>. |
| style | CSSProperties | Inline style for the outer <figure>. |