Vesture

Charts

FunnelChartNew in 0.7.0

A conversion funnel: stages stack top to bottom and narrow with their value, with step-over-step and total-conversion percentages.

FunnelChart

Preview

Gap 2px
Visits: 12,400 (100%)Visits12,400Sign-ups: 5,200 (42%)Sign-ups5,200 · 42% of previousTrials: 2,100 (17%)Trials2,100 · 40% of previousPaid: 640 (5%)Paid640 · 30% of previous

Click a stage.

Usage

tsx
import { FunnelChart } from "@vesture/react";

<FunnelChart
  width={480}
  height={320}
  shape="stepped"
  metric="total"
  stages={[
    { key: "visit", label: "Visits", value: 12400 },
    { key: "signup", label: "Sign-ups", value: 5200 },
    { key: "paid", label: "Paid", value: 640 },
  ]}
  formatValue={(v) => v.toLocaleString()}
/>

Behavior

  • Each stage's width is its value relative to the first stage. shape="tapered" slopes every stage into the next; "stepped" draws flat-sided bars with gaps for a more tabular look.
  • metric chooses the secondary figure: percent of the previous stage, percent of the first stage, or none.
  • Stages with negative values are ignored; a funnel whose first stage is zero renders the empty state.
  • renderLabel receives each segment's geometry and conversion numbers for fully custom labels; onStageClick makes stages interactive.

Props

PropTypeDefaultDescription
stages{ key: string; label: string; value: number; color?: string }[]—Required. Ordered top to bottom.
width / heightnumber—Required.
shape"tapered" | "stepped""tapered"
gapnumber2Vertical gap between stages.
colorsstring[]—Cycled by index; default is the chart series palette.
metric"previous" | "total" | "none""previous"Secondary figure under each label.
formatValue(value: number) => stringString
renderLabel(segment, geometry) => ReactNode—Custom SVG label per stage.
onStageClick(stage, index) => void—