Waterfall Chart

Show how an initial value is affected by a sequence of positive and negative changes. Waterfall charts are a staple of financial dashboards for cash flow, budgets, and variance analysis — with running totals, connector lines, and color-coded steps.

CLI Installation
Increase / Decrease / Total
Running Totals
Connector Lines
Horizontal & Vertical
Interactive Tooltips
Keyboard Accessible
Performance Optimized
TypeScript
Zero Dependencies

Basic Example

A quarterly cash-flow waterfall — a starting total, a series of gains and losses, and a closing total

Loading...
Selected: Click a bar to select
Orientation:

Installation

Get started with the WaterfallChart component in just a few steps.

Quick Install
bash
npx mario-charts@latest add waterfall-chart
Zero Lock-in Philosophy
The component is fully yours to own, modify, and customize.

Examples

Explore different configurations and use cases for the WaterfallChart component.

Automatic Type Inference

Omit the type field and the chart infers increases and decreases from the sign of each value — only totals need to be marked explicitly

Loading...

Horizontal Orientation

A horizontal budget breakdown — useful when step labels are long or you have many steps

Loading...

Custom Colors

Override any of the three bar types via the colors prop

Default

green / red / blue

Loading...

Custom

colors={{ increase: '#8b5cf6', decrease: '#f59e0b', total: '#0ea5e9' }}

Loading...

Chart States

Built-in loading, error, and empty states

Loading

Error

Chart Error
Network connection failed

Empty

No Data
There's no data to display

API Reference

Complete TypeScript interface with all available props and configurations.

PropTypeDefaultDescription
datarequired
readonly T[]Array of step objects (label, value, and optional type) to display
x
keyof T'label'Key from each object to use for the step label
y
keyof T'value'Key from each object holding the numeric value
type
keyof T'type'Key holding each step's type ('increase' | 'decrease' | 'total'). When absent, the type is inferred from the sign of the value
colors
{ increase?: string; decrease?: string; total?: string }{ increase: '#10b981', decrease: '#ef4444', total: '#3b82f6' }Override the color used for each bar type
orientation
'vertical' | 'horizontal''vertical'Layout direction of the bars
showConnectors
booleantrueDraw the connector lines that link each step's running total to the next
showValues
booleanfalseRender the signed delta (or absolute total) on each bar
showLegend
booleanfalseShow the increase / decrease / total legend below the chart
showGrid
booleanfalseShow value grid lines and axis tick labels
gridStyle
'solid' | 'dashed' | 'dotted''dashed'Style of the grid lines when showGrid is enabled
height
number300Height of the chart in pixels
loading
booleanfalseShow loading state with animated skeleton
error
string | nullnullError message to display
animation
booleantrueEnable entrance animations (respects prefers-reduced-motion)
onBarClick
(data: T, index: number) => voidCallback fired when a bar is clicked
tooltipRenderer
(data: WaterfallChartTooltipData<T>) => React.ReactNodeCustom tooltip render function for full control over tooltip content
className
stringAdditional CSS classes to apply to the container