Waterfall Chart
Documentation Index
Fetch the complete documentation index at: /llms.txt. Use this file to discover all available pages before exploring further.
Bridges, deltas, and totals stacked as one composable BeeChart
Installation
Usage
The waterfall chart is composible on top of stacked <Bar /> geometries (transparent “base” + visible segment). Provide rows with semantic WaterfallType (start, increase, decrease, total) encoded at typeKey (defaults to "type"), display names (nameKey), deltas (valueKey), gradients via chartConfig. Compose <Grid />, <XAxis />, <YAxis />, <Bars />, <Tooltip />, <Legend /> as needed plus optional backgroundVariant on the root — remaining behavior forwards into Recharts <BarChart />; see BarChart docs when extending through chartProps.
import {
BeeWaterfallChart,
Bars,
Grid,
XAxis,
YAxis,
Tooltip,
Legend,
} from "@/components/beecharts/charts/waterfall-chart";<BeeWaterfallChart
config={chartConfig}
data={rows}
nameKey="name"
valueKey="amount"
typeKey="type"
backgroundVariant="dots"
>
<Grid vertical={false} />
<XAxis />
<YAxis />
<Bars isClickable glowingBars={["product-a"]} />
<Tooltip />
<Legend isClickable />
</BeeWaterfallChart>Interactive Selection
Set isClickable on <Bars /> and <Legend /> as needed — onSelectionChange carries { dataKey, value } | null, where dataKey aligns with names from nameKey and values reflect stacking math (start resets running totals, totals span full magnitude, deltas offset previous balance):
<BeeWaterfallChart
config={chartConfig}
data={rows}
nameKey="name"
valueKey="amount"
onSelectionChange={(selection) => {
if (selection) {
console.log("Selected:", selection.dataKey, selection.value);
} else {
console.log("Deselected");
}
}}
>
<Grid />
<XAxis />
<YAxis />
<Bars isClickable />
<Legend isClickable />
<Tooltip />
</BeeWaterfallChart>Loading State
The waterfall chart supports loading state. Pass isLoading to shimmer placeholder bars synthesized from seeded loading rows (loadingBars) while real deltas resolve.
Examples
Intro animation
Bars grow in on first paint with a staggered motion.dev reveal (Recharts’ built-in bar animation is disabled, same as other Bee charts). Control order with animationType on the root — "left-to-right" (default), "right-to-left", "center-out", "edges-in", or "none". Respects the OS reduce-motion preference.
<BeeWaterfallChart animationType="center-out" ...>Glowing Bars
API Reference
The chart is composed of several parts. The props below are grouped by the component they belong to.
The root container bridging raw financial rows → cumulative stack-friendly records (base + barValue). Tracks selection highlighting, translucent reference line (y={0}), rounded rect edges, gradients, legends, glowing filters, shimmer skeleton overlays when isLoading.
Configuration slot translating user intent (isClickable, glowingBars) into per-rect handlers + defs.
Cartesian scaffolding with sane defaults balancing dense financial labeling.
Category axis keyed to nameKey, hidden during loading shimmer.
Numeric axis bridging positive / negative deltas with zero reference line synergy.
Selection-aware formatter with subdued crosshair fill (muted translucent band).
Per-bridge legends mirroring clickable selection state.
WaterfallType strings drive preprocessing before bars render (start, increase, decrease, total).