Dumbbell charts
A dumbbell chart compares two values per category: before and after, last year and this year, plan and actual. A hollow dot marks the first value, a filled dot the second, and the line between them shows how far and which way it moved.
Before and after
DumbbellSeries takes the category in XValue, the first value in FromValue and the second
in YValue. With Horizontal the categories are rows, the usual layout; the value axis fits the values
instead of starting at zero. DataLabels writes each value outside its dot. The tooltip shows "22 → 35 (+13)".
Name the series after both ends, e.g. "2016 → 2026"; the legend shows a small dumbbell.
Code
<RioChart TItem="City" Items="cities" Title="Trips by bike" Horizontal="true">
<DumbbellSeries Name="2016 → 2026" XValue="c => c.Name" FromValue="c => c.Then" YValue="c => c.Now"
Format="0'%'" DataLabels="true" />
</RioChart>
@code {
record City(string Name, double Then, double Now);
}Plan against actual
Upright, with the categories along the bottom, a dumbbell reads as a gap from a plan. ColorValue colors the second
dot, here red where the month fell short. With Aggregate, items in the same category make one dumbbell; both ends
are combined the same way.
Code
<RioChart TItem="Month" Items="months" Title="Hours">
<DumbbellSeries Name="Plan → actual" XValue="m => m.Name" FromValue="m => m.Plan" YValue="m => m.Actual" Format="0 h"
ColorValue='m => m.Actual < m.Plan ? "--rio-negative" : null' />
</RioChart>
@code {
record Month(string Name, double Plan, double Actual);
}In JSON definitions
"type": "dumbbell" (also connectedDot, dotPlot) with x, a "from" field with
the first values and y with the second. "horizontal": true on the chart makes rows.
{ "dataset": "trips", "horizontal": true, "series": [ { "type": "dumbbell", "x": "city", "from": "share2016", "y": "share2026" } ] }