Funnel Chart
A funnel chart recipe - Recharts drawn with Appica UI tokens, for steps that lose volume.
A funnel chart shows how much of a volume survives each step of a process. Like every chart here it is a recipe: Recharts draws it and the chart layer themes it. Each example below is a complete file to paste and adapt.
Installation
Recharts is the only extra dependency, with react-is at the same version as react:
pnpm add recharts react-isThe examples import the chart layer from @/components/chart. If your project doesn't have it yet, copy it from the Charts page first.
Example
Every step is the same color, because the steps are 1 measure, and a stroke in the surface color separates them. The rows go largest first. width="70%" on the Funnel leaves room beside it for the step names, and lastShapeType="rectangle" ends it on a bar instead of a point.
Accessibility
- Pass
aria-labelto the chart with what it shows ("Store visitors from first visit to order"). It becomes the accessible name of the SVG. - The chart takes focus, which opens the tooltip on the first step. Recharts doesn't move it between the steps of a funnel with the arrow keys, so keep the step names as labels in the chart, and put the numbers in a table when readers need them.
- Nothing depends on color: every step is named beside its shape.
- Nothing animates under reduced motion.