Skip to main content

FunnelChart

Every example on this page is live, drawn by the library's Storybook, where you can also change its props and see the result.

A sequential funnel visualization using SVG trapezoids. Each stage narrows to represent drop-off, using patterns to differentiate stages. The last stage narrows to a spout.

The funnel stretches to fill whatever box the chart is given, including a widget's stored preview, while its outlines, patterns and labels keep their size. A funnel that widens is scaled so its widest stage still fits.

Import​

import { FunnelChart } from "~lib/charts/funnel-chart";

Props​

NameTypeRequiredDefaultDescription
data{ label: string; value: number; pattern?: PatternType }[]YesN/AFunnel stages
showValuesbooleanNofalseShow numeric values on each stage
showPercentagebooleanNotrueShow percentage relative to first stage
widthnumber | stringNo300Chart width
heightnumber | stringNo300Chart height

PatternType: "solid" | "diagonal" | "dots" | "crosshatch" — cycles automatically if not specified.

Examples​

Simple​

Open Simple in Storybook

With Values​

Open With Values in Storybook

No Percentages​

Open No Percentages in Storybook

Custom Patterns​

Open Custom Patterns in Storybook

See Also​