Waterfall chart
Since 0.1.0-alpha.22Use a waterfall to explain how a total was reached, such as profit from revenue and costs, or a budget's variance. When nothing is subtracted, stacked bars are simpler. For the total's trend alone, use a line chart.
Changes and totals
ChartWaterfallSeries takes each item's Value as a change, here from revenue down to net profit. Each item that Total marks stands on the baseline and shows the total so far, whatever its own Value: here gross, operating and net profit.
Static
Preview
- Increase
- Decrease
- Total
| Name | Amount |
|---|---|
| Revenue | $1,240K |
| Cost of sales | −$498K |
| Gross profit | $742K |
| Salaries | −$312K |
| Marketing | −$96K |
| Rent | −$48K |
| Operating profit | $286K |
| Interest | +$12K |
| Tax | −$62K |
| Net profit | $236K |
Code
@* A quarter's profit and loss, line by line from revenue to net profit: bars across, so each line's
name reads flat, and every bar labeled, so the value axis and its grid lines step aside. *@
<Chart Items="_lines" Argument="l => l.Name" Title="Profit and loss, Q3 2026" Orientation="Orientation.Horizontal">
<ChartValueAxis Format="$#,##0,K" HideLabels GridLines="false" />
<ChartWaterfallSeries Value="l => l.Amount" Total="l => l.IsTotal" Labels="ChartLabels.Auto" />
</Chart>
{
private record PnlLine(string Name, decimal Amount, bool IsTotal = false);
private readonly PnlLine[] _lines =
[
new("Revenue", 1_240_000),
new("Cost of sales", -498_000),
new("Gross profit", 0, IsTotal: true),
new("Salaries", -312_000),
new("Marketing", -96_000),
new("Rent", -48_000),
new("Operating profit", 0, IsTotal: true),
new("Interest", 12_000),
new("Tax", -62_000),
new("Net profit", 0, IsTotal: true),
];
}Add this example to a page with the izzy CLI:
izzy add component ChartWaterfallSeries --at <file>:<line>The first bar, the starting amount, also stands on the baseline. Line items read best as bars across, with Orientation set to Horizontal, so their names stay flat.
IncreaseColor, DecreaseColor and Color (the totals') set the colors. The default blue and red stay apart for red-green color blindness.
Labels write each change signed, such as −$498K. With every bar labeled, the value axis's labels and grid lines step aside. A waterfall is its chart's only series.
Changes over time
For changes over time, such as a year's cash flow, keep the columns upright so time runs left to right: the opening balance, each month's net change, and the closing balance as a Total.
Static
Preview
- Increase
- Decrease
- Total
| Name | Change |
|---|---|
| Opening | $420K |
| Jan | −$38K |
| Feb | −$22K |
| Mar | +$64K |
| Apr | +$18K |
| May | −$51K |
| Jun | +$87K |
| Jul | −$12K |
| Aug | −$44K |
| Sep | +$73K |
| Oct | +$29K |
| Nov | −$16K |
| Dec | +$95K |
| Closing | $603K |
Code
@* A year's cash, month by month: changes over time read left to right as columns, from the
opening balance to the closing one. *@
<Chart Items="_months" Argument="m => m.Name" Title="Cash on hand, 2026">
<ChartValueAxis Format="$#,##0,K" />
<ChartWaterfallSeries Value="m => m.Change" Total="m => m.IsTotal" Labels="ChartLabels.Auto" LabelFormat="$#,##0,K" />
</Chart>
{
private record CashMonth(string Name, decimal Change, bool IsTotal = false);
private readonly CashMonth[] _months =
[
new("Opening", 420_000),
new("Jan", -38_000),
new("Feb", -22_000),
new("Mar", 64_000),
new("Apr", 18_000),
new("May", -51_000),
new("Jun", 87_000),
new("Jul", -12_000),
new("Aug", -44_000),
new("Sep", 73_000),
new("Oct", 29_000),
new("Nov", -16_000),
new("Dec", 95_000),
new("Closing", 0, IsTotal: true),
];
}Details
The first bar, the starting amount, and each item that's a Total stand on the baseline, a total showing everything so far. Rises, falls and totals each take a color, and the changes read signed ("+12,000", "−4,500"). Line items such as a profit and loss read best as bars across (the chart's Orientation.Horizontal); changes over time, as columns. A waterfall is its chart's only series, and the chart's legend keys its three colors.
Mode support
| Feature | Static | Interactive |
|---|---|---|
| Rises, falls and totals in three colors, keyed in the legend | Yes | Yes |
| Changes written signed, so color isn't the only cue | Yes | Yes |
| Bars across for line items, columns for changes over time | Yes | Yes |
| Drawn on the server, as wide as its container, with labels that thin out as it narrows | Yes | Yes |
| A table of the values behind a "Show data" button | Yes | Yes |
| Tooltips on hover and from the keyboard | Yes | Yes |
Static: static server-side rendering, with no circuit and no WebAssembly. Interactive: Server, WebAssembly or Auto.
Without JavaScript
Every page starts as plain HTML: before IzzyBlazor's script loads on a static page, while an interactive page prerenders, and with JavaScript off.
- Tooltips on hover and from the keyboard: waits for the script
Parameters
| Prop | Type | Default |
|---|---|---|
TotalWhich items are totals, such as r => r.IsTotal: each is a bar from zero showing everything so far (gross profit, net profit), whatever its own Value. | Expression<Func<TItem, bool>>? | |
OpacityHow solid the bars are, from 0 (the surface's color) to 1 (the bar's color). | double? | computed |
IncreaseColorThe CSS color of bars that add, such as var(--ib-color-success). | string? | computed |
DecreaseColorThe CSS color of bars that take away. | string? | computed |
ValueThe value to draw, such as m => m.Revenue: any number, or null for none. | Expression<Func<TItem, object?>> | Required |
AggregateWith ChartDrillLevel<T>s, how each level adds up its items' values: DataAggregate.Sum (the default), DataAggregate.Avg, DataAggregate.Min, DataAggregate.Max or DataAggregate.Count (the items with a value). | DataAggregate | DataAggregate.Sum |
NameThe series' name, in the legend, the data table and each value's description. | string? | computed |
SeriesBySplits the series into one per value of this, such as p => p.Device: each draws only its own items' values, is named by its value, and takes the next color and marker, in the order the values first appear. | Expression<Func<TItem, object?>>? | |
ColorA CSS color, such as var(--ib-color-danger) or #0f766e. | string? | computed |
LabelsWrites each value beside its bar or point. | ChartLabels | ChartLabels.None |
LabelFormatA .NET format string for this series' labels, such as C0. | string? | computed |
LabelTextWhat each label says in place of its value, such as r => r.Region to name each bubble or point. | Expression<Func<TItem, object?>>? | |
LabelOverlapWhat labels do when they'd overlap others: left out at those widths (ChartLabelOverlap.Hide, the default), or shown anyway (ChartLabelOverlap.Show). | ChartLabelOverlap | ChartLabelOverlap.Hide |
TrendDraws a trend through the values: a dashed line in the series' color, named "Revenue trend" (a moving average "Revenue, 7-day average") in the legend, tooltips and data table. | ChartTrend | ChartTrend.None |
TrendOrderA polynomial trend's order, 2 (a parabola) to 6. | int | 2 |
TrendPeriodHow many values a moving average takes in, 2 or more. | int | 3 |
TrendColorThe trend's CSS color, such as var(--ib-color-danger), used as given. | string? | computed |
ValueAxisThe Name of the value axis the series is read off, for a measure in other units on a second axis at the end side, such as "margin". | string? | computed |
HiddenStarts with the series hidden: the chart is drawn as if it weren't there, and it keeps its place in the legend, to show it again, and in the data table. | bool | false |