Reference lines
Since 0.1.0-alpha.22Lines at a target or an average, and shaded ranges of values or arguments such as a season, each labeled in text and said in the chart's description.
Reference lines and bands
To mark a value, such as a target, put a ChartReferenceLine in the chart with its series and set its Value. It's a dashed line with its Label just above it at the left, or where LabelAlign puts it: Start, Center or End.
Static
Preview
$0$50,000$100,000$150,000$200,000
JanFebMarAprMayJunJulAugSepOctNovDec
Jan
Revenue
$84,200
Feb
Revenue
$91,500
Mar
Revenue
$102,300
Apr
Revenue
$98,700
May
Revenue
$110,400
Jun
Revenue
$121,900
Jul
Revenue
$117,600
Aug
Revenue
$126,300
Sep
Revenue
$133,800
Oct
Revenue
$141,200
Nov
Revenue
$156,900
Dec
Revenue
$172,400
Revenue against target, 2026
| Month | Revenue |
|---|---|
| Jan | $84,200 |
| Feb | $91,500 |
| Mar | $102,300 |
| Apr | $98,700 |
| May | $110,400 |
| Jun | $121,900 |
| Jul | $117,600 |
| Aug | $126,300 |
| Sep | $133,800 |
| Oct | $141,200 |
| Nov | $156,900 |
| Dec | $172,400 |
Code
@* Monthly revenue against the year's target and its own average, with the holiday season shaded. *@
<Chart Items="_months" Argument="m => m.Month" Title="Revenue against target, 2026">
<ChartValueAxis Format="C0" />
<ChartBarSeries Value="m => m.Revenue" Name="Revenue" />
<ChartReferenceLine Value="150_000" Label="Target $150K" />
<ChartReferenceLine Statistic="ChartStatistic.Average" Series="Revenue" />
<ChartReferenceBand ArgumentFrom="("Nov")" ArgumentTo="("Dec")" Label="Holiday season" />
</Chart>
{
private record MonthRevenue(string Month, decimal Revenue);
private readonly MonthRevenue[] _months =
[
new("Jan", 84_200), new("Feb", 91_500), new("Mar", 102_300), new("Apr", 98_700),
new("May", 110_400), new("Jun", 121_900), new("Jul", 117_600), new("Aug", 126_300),
new("Sep", 133_800), new("Oct", 141_200), new("Nov", 156_900), new("Dec", 172_400),
];
}The value axis always reaches a reference line, so a target above every value still shows. With Statistic and a series' name as Series, the line is that series' Average or Median.
ChartReferenceBand shades a range of values from From to To, or of arguments from ArgumentFrom to ArgumentTo, here November and December.