Skip to content
IzzyBlazor

Enter all results ↑ ↓ move Esc close

Waterfall chart

Since 0.1.0-alpha.22
Walks from a starting amount through rises and falls to a result, with totals along the way.

Use 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

Profit and loss, Q3 2026
  • Increase
  • Decrease
  • Total

Code

Usage.razor
@* 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>

@code {
    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:

bash
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

Cash on hand, 2026
  • Increase
  • Decrease
  • Total

Code

WaterfallOverTime.razor
@* 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>

@code {
    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

What works in each mode, Waterfall chart
FeatureStaticInteractive
Rises, falls and totals in three colors, keyed in the legendYesYes
Changes written signed, so color isn't the only cueYesYes
Bars across for line items, columns for changes over timeYesYes
Drawn on the server, as wide as its container, with labels that thin out as it narrowsYesYes
A table of the values behind a "Show data" buttonYesYes
Tooltips on hover and from the keyboardYesYes

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

ChartWaterfallSeries parameters
PropTypeDefault
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).DataAggregateDataAggregate.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.ChartLabelsChartLabels.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).ChartLabelOverlapChartLabelOverlap.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.ChartTrendChartTrend.None
TrendOrderA polynomial trend's order, 2 (a parabola) to 6.int2
TrendPeriodHow many values a moving average takes in, 2 or more.int3
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.boolfalse

Connection lost

Rejoining the server…