Funnel Chart
Documentation Index
Fetch the complete documentation index at: /llms.txt. Use this file to discover all available pages before exploring further.
Stage-based funnel visuals built atop composable EvilCharts primitives
Installation
Usage
The funnel chart is composible. <EvilFunnelChart> wraps a vertically laid out Recharts <BarChart> with custom trapezoid shapes per stage (stageKey) and measured values (valueKey). Compose <Grid />, <XAxis />, <YAxis />, <Stages />, <Tooltip />, <Legend /> as needed, and set optional backgroundVariant on the chart root — Recharts has no standalone funnel primitive, but every native chart prop can pass through chartProps alongside the underlying BarChart escape hatch documented below.
import {
EvilFunnelChart,
Stages,
XAxis,
YAxis,
Grid,
Tooltip,
Legend,
} from "@/components/evilcharts/charts/funnel-chart";<EvilFunnelChart
config={chartConfig}
data={funnelRows}
stageKey="stage"
valueKey="amount"
backgroundVariant="dots"
>
<YAxis />
<XAxis />
<Stages isClickable glowingStages={["trials"]} />
<Grid />
<Tooltip />
<Legend isClickable />
</EvilFunnelChart>Interactive Selection
Add isClickable to <Stages /> (plus <Legend /> when you want swatches clickable) then listen on onSelectionChange ({ dataKey, value } | null). dataKey matches rows’ stageKey string:
<EvilFunnelChart
config={chartConfig}
data={funnelRows}
stageKey="stage"
valueKey="amount"
onSelectionChange={(selection) => {
if (selection) {
console.log("Selected:", selection.dataKey, selection.value);
} else {
console.log("Deselected");
}
}}
>
<YAxis />
<XAxis />
<Stages isClickable />
<Legend isClickable />
<Tooltip />
</EvilFunnelChart>Loading State
The funnel chart supports loading state. Pass isLoading to shimmer placeholder stages synthesized from deterministic loading rows while awaiting real funnel data (tune fictitious heights with loadingStages).
Examples
Glowing Stages
API Reference
The chart is composed of several parts. The props below are grouped by the component they belong to.
The root container wrapping a vertical <BarChart>. Holds stage metadata, synthesized loading rows when isLoading, max-value scaling shared by funnel shapes, and selection state surfaced to <Stages />/<Legend />.
Configuration slot mirrored by funnel renderer — determines whether polygons listen for clicks / glow defs.
Mirrors numeric scale even though EvilFunnel hides ticks by default to keep silhouette clean (hide forwarding Recharts semantics).
Shows ordered funnel stages (category axis for vertical funnel layout).
Optional vertical-only dashed scaffolding for alignment reference.
Disables Cartesian cursor crosshair (cursor={false}) for cleaner funnel hovering.
Stage keyed legend syncing dimming + selection mirrored from <Stages />.