Waterfall Chart in C#
Build waterfall and bridge charts in C# with AddWaterfall — running totals, absolute total bars, rendered as self-contained SVG. MIT licensed .NET library.
Waterfall Chart
ChartType.Waterfall — incremental running-total chart.
When to use a waterfall chart
Reach for it when
- Showing how a starting figure becomes an ending figure through named contributions — P&L bridges, variance analysis.
- Headcount, inventory, or cash movement where additions and subtractions both matter.
- Any narrative of the form "we started here, these things happened, we ended here".
Use something else when
- Contributions that do not actually sum to the end value. The chart asserts they do.
- More than about ten steps — the running baseline gets hard to follow.
- Unordered categories. The sequence is the chart's argument, so it must be meaningful.
Waterfall Chart in C#
Lifted verbatim from the chart types reference, so it compiles against the shipped API. See the API reference for every overload and the exact data types each series method accepts.
string svg = ChartBuilder.Create()
.Title("Annual Cash Flow Analysis")
.Size(720, 440)
.XAxis(x => x.Categories.AddRange(new[]
{ "Opening","Revenue","COGS","Gross Profit","OpEx","EBITDA","Tax","Net Profit" }))
.YAxis(y => y.Title = "USD ($k)")
.AsAnimated()
.Series(s => s
.AddWaterfall(
name: "P&L",
data: new double?[] { 500, 800, -320, 980, -450, 530, -120, 410 },
totals: new[] { true, false, false, true, false, true, false, true }))
.RenderToSvg();Install
dotnet add package TerraFluent.Chart.Reporting
- MIT licensed — free for commercial use, no chart limits, no watermarks.
- Zero dependencies — nothing but the .NET base class library.
- netstandard2.0 through net10.0 — .NET Framework 4.6.1+, .NET Core 2.0+, and every modern release.
- Output is one SVG string — embed it in HTML, a PDF, or a Word document.