Dumbbell Chart in C#
Build dumbbell and dot-plot charts in C# with AddDumbbell and RangePoint — before/after comparison per category as self-contained SVG.
Dumbbell / Dot-Plot
AddDumbbell() — two dots per category connected by a vertical line.
When to use a dumbbell chart
Reach for it when
- Two points in time per category, where the size of the change is the finding — before and after, plan and actual.
- Comparing gaps across categories; the connector length is easy to compare at a glance.
- Cases where two grouped columns would waste ink to say the same thing.
Use something else when
- More than two values per category — a dumbbell has exactly two ends.
- Series where the direction of change flips between categories without a colour cue; the reader cannot tell which dot is which.
- Data where the absolute values matter more than the gap; grouped columns read those better.
Dumbbell 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("Salary Change After Promotion")
.Size(700, 420)
.XAxis("Role", "Junior","Mid","Senior","Lead","Principal")
.YAxis("Salary ($k)", min: 0)
.AsAnimated()
.Series(s => s
.AddDumbbell("Before → After", new[]
{
new RangePoint( 60, 72), new RangePoint( 85, 100),
new RangePoint(110, 132), new RangePoint(140, 168),
new RangePoint(175, 210),
}, cfg => cfg.Color(ChartColor.ChartBlue)))
.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.