Area Range Chart in C#
Render low-high confidence bands in C# with AddAreaRange and RangePoint — forecast ranges and uncertainty envelopes as self-contained SVG.
Area Range
AddAreaRange() — filled band between a lower and upper line.
When to use a area range chart
Reach for it when
- Forecast and prediction intervals, usually with the central estimate drawn over the band as a line.
- Min/max or percentile envelopes over a continuous axis.
- Any "expected range" that should read as a region rather than a set of points.
Use something else when
- Discrete categories — the band implies continuity between them.
- More than two overlapping bands; the fills compound and nothing stays legible.
- Showing the band without its central series, which leaves the reader no estimate to anchor on.
Area Range 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.
using TerraFluent.Chart.Reporting.Models;
string svg = ChartBuilder.Create()
.Title("Revenue Forecast — Confidence Band")
.Size(700, 380)
.XAxis("Week", "W1","W2","W3","W4","W5","W6","W7","W8")
.YAxis(y => { y.Title = "Revenue ($k)"; y.Min = 80; y.Max = 280; })
.AsAnimated()
.Series(s => s
// Mean forecast line on top
.AddLine("Forecast",
new double[] { 140, 152, 161, 170, 178, 185, 192, 200 },
cfg => cfg.Color("#2ecc71").LineWidth(2))
// Confidence band underneath
.AddAreaRange("Confidence Band",
new[]
{
new RangePoint(120, 160), new RangePoint(130, 172), new RangePoint(138, 184),
new RangePoint(148, 192), new RangePoint(155, 200), new RangePoint(160, 210),
new RangePoint(167, 217), new RangePoint(174, 226),
},
cfg => cfg.Color("#2ecc71"))) // same colour, semi-transparent fill
.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.