FunnelChart

Stage-to-stage conversion as a centered funnel.

Import

import { FunnelChart } from '@matix/charts/funnel-chart';

Usage

Stages render top to bottom in the order you pass them — the funnel never re-sorts, so a classic signup funnel reads Visits → Signups → Activated → Paid.

Segments default to solid; choose light or gradient when the funnel needs a lower-emphasis or dimensional treatment.

Data for Visits, Signups, Activated, Paid
CategoryValue
Visits:12,400.
Signups:4,900.
Activated:2,300.
Paid:940.

Without labels

Turn off the label gutter for a denser plot, and opt into the legend since the labels are no longer naming each stage.

Data for Visits, Signups, Activated, Paid
CategoryValue
Visits:12,400.
Signups:4,900.
Activated:2,300.
Paid:940.

API Reference

PropTypeDefaultDescription
datareadonly ChartDatum[]—Stages, rendered top to bottom in the given order; non-positive values are skipped
fillChartFillsolidSegment treatment: solid, light, or gradient
widthnumber—Controlled layout width; enables deterministic SSR
initialWidthnumber—SSR width hint replaced by client measurement
heightnumber280SVG height in px — width is measured from the container
showLabelsbooleantrueStage labels + values in a right gutter
showTooltipbooleantrueShow the hover tooltip (value and conversion share)
showLegendbooleanfalseShow the legend — opt-in, since labels already name the stages
animatebooleantrueSegments grow in from the center line, staggered top to bottom
formattersChartFormatters—Format stage labels and values across labels, tooltips, legends, and data
labelstring—Accessible name; defaults to the joined stage labels
labelsChartLabels—Screen-reader text of the data table and the legend, for translation
showLabelbooleanfalseRender label as a visible title above the plot
sxStyleXStyles—StyleX style override

ChartDatum

FieldTypeDescription
idstringStable data identity
labelstringStage label, falls back to id
colorIndexnumberPalette slot 0–7; defaults to input order
valuenumberStage magnitude; must be finite and positive to render

Accessibility

  • label provides the concise image name. description adds a richer summary through aria-describedby; consumer-owned text or a visible table can be linked with the aria-describedby prop.
  • Up to 20 rendered stages receive a visually hidden native data table. accessibleData replaces that table with custom React content; pass null to suppress it. labels translates the table text and the legend name.
  • Segment marks remain aria-hidden; the chart is one image target and the table carries stage values.
  • The pointer tooltip is supplemental; the table carries values for assistive technology.
  • The opt-in legend pairs every palette swatch with a text label; it does not claim a second visual encoding beyond color.

Server rendering

Pass width for deterministic server-rendered SVG. Use initialWidth for responsive hydration from a server estimate. Without either prop, the wrapper reserves height before client measurement.