FunnelChart
Loading example…
Funnel and pyramid: stage widths follow the value, the outline stays continuous between stages, and the conversion rate between consecutive stages sits on the joint. Vertical or horizontal, adapts to narrow containers (labels shrink and truncate, tooltip carries the detail).
Import
Section titled “Import”import { FunnelChart } from "@jcsoftdev/ui/charts";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/charts/funnel-chart.
<FunnelChart title="Embudo de reservas del mes" stages={bookings} variant="funnel" orientation="vertical" tapered neck={0.72} showConversion tone="categorical" gap={4} valueFormat="integer" tooltip loading={false} animate labels={spanishLabels}/>| Prop | Type | Default | Description |
|---|---|---|---|
title * |
string |
||
description |
string |
||
stages * |
readonly FunnelDatum[] |
Stages in order: widest first. | |
variant |
"funnel" | "pyramid" |
"funnel" |
funnel narrows towards the last stage; pyramid tapers it to a point with the first stage as the base. |
orientation |
"horizontal" | "vertical" |
"vertical" |
|
tapered |
boolean |
true |
Trapezoid stages that narrow into the next one (default); false draws straight bars of each stage’s own width. |
neck |
number |
0.72 |
How far the last stage narrows, as a fraction of its width (funnel, tapered). |
showConversion |
boolean |
true |
Conversion % between consecutive stages. |
tone |
"accent" | "categorical" |
"categorical" |
categorical colors each stage; accent fades one brand color. |
gap |
number |
4 |
Space between stages, in pixels. |
height |
number | "fill" |
||
aspectRatio |
number |
Width / height ratio; sizes the drawing from the container width when height is not “fill”. |
|
valueFormat |
ValueFormat |
||
tooltip |
boolean |
true |
|
loading |
boolean |
false |
|
animate |
boolean |
true |
|
labels |
Partial<FunnelLabels> |
||
className |
string |
* marks a required prop.
Storybook stories
Section titled “Storybook stories”- Default
- Tapered
- Stepped
- Horizontal Tapered
- Horizontal
- Accent Ramp
- Pyramid
- Horizontal Pyramid
- Without Conversion
- Loading
- Empty
- Narrow
- Narrow Horizontal
- Fill Parent
Source
Section titled “Source”packages/ui/src/charts/funnel-chart/funnel-chart.tsx