Range area chart
Since 0.1.0-alpha.23Use a range area for a span that changes over time, such as a forecast's uncertainty or a year of daily temperatures. Many readers take a band's edges as hard limits, so name what it covers, such as "80% interval". For separate names instead of dates, use range bars.
A band with a line through it
ChartRangeAreaSeries fills a band between each item's Low and High. To show the measure inside it, such as a forecast, add a ChartLineSeries after the band, so the line is drawn on top.
Static
Preview
- 80% interval
- Expected
| Month | 80% interval | Expected |
|---|---|---|
| Jan | $402K – $434K | $418K |
| Feb | $398K – $445K | $421K |
| Mar | $409K – $466K | $437K |
| Apr | $411K – $479K | $444K |
| May | $417K – $494K | $455K |
| Jun | $418K – $506K | $461K |
| Jul | $414K – $514K | $463K |
| Aug | $419K – $528K | $472K |
| Sep | $426K – $545K | $484K |
| Oct | $431K – $560K | $494K |
| Nov | $444K – $584K | $512K |
| Dec | $462K – $614K | $536K |
Code
@* Next year's monthly revenue forecast: the expected amount as a line, and the 80% interval
around it as a band that widens as the months run further out. *@
<Chart Items="_forecast" Argument="f => f.Month" Title="Revenue forecast, 2027">
<ChartValueAxis Format="$#,##0,K" />
<ChartRangeAreaSeries Low="f => f.Low" High="f => f.High" Name="80% interval" Curve="ChartCurve.Smooth" />
<ChartLineSeries Value="f => f.Expected" Name="Expected" Curve="ChartCurve.Smooth" LineStyle="ChartLineStyle.Solid" />
</Chart>
{
private record Forecast(string Month, decimal Low, decimal Expected, decimal High);
private readonly Forecast[] _forecast =
[
new("Jan", 402_000, 418_000, 434_000), new("Feb", 398_000, 421_000, 445_000),
new("Mar", 409_000, 437_000, 466_000), new("Apr", 411_000, 444_000, 479_000),
new("May", 417_000, 455_000, 494_000), new("Jun", 418_000, 461_000, 506_000),
new("Jul", 414_000, 463_000, 514_000), new("Aug", 419_000, 472_000, 528_000),
new("Sep", 426_000, 484_000, 545_000), new("Oct", 431_000, 494_000, 560_000),
new("Nov", 444_000, 512_000, 584_000), new("Dec", 462_000, 536_000, 614_000),
];
}Add this example to a page with the izzy CLI:
izzy add component ChartRangeAreaSeries --at <file>:<line>Say in the band's Name what it spans, such as "80% interval" or "Min to max": a band with no stated meaning reads as a hard limit.
Curve shapes both edges; give the line the same curve so it stays inside.
Details
Draw the measure inside it (the forecast, the average) as a ChartLineSeries<T> on top, and say in the band's Name what it spans, such as "80% interval".
Mode support
| Feature | Static | Interactive |
|---|---|---|
| A band between the lows and highs, edged on both sides | Yes | Yes |
| A line through it from a line series, such as the forecast | Yes | Yes |
| A value axis that fits the band, not drawn down to zero | Yes | Yes |
| Each range read low first in tooltips and the table | Yes | Yes |
| Legend items that hide and show the band | Yes | Yes |
| A table of the values behind a "Show data" button | Yes | Yes |
| Tooltips on hover and from the keyboard | Yes | Yes |
Static: static server-side rendering, with no circuit and no WebAssembly. Interactive: Server, WebAssembly or Auto.
Without JavaScript
Every page starts as plain HTML: before IzzyBlazor's script loads on a static page, while an interactive page prerenders, and with JavaScript off.
- Legend items that hide and show the band: waits for the script
- Tooltips on hover and from the keyboard: waits for the script
Parameters
| Prop | Type | Default |
|---|---|---|
LineStyleHow the band's edges are drawn. | ChartLineStyle? | computed |
CurveThe band's shape between values, at both edges. | ChartCurve | ChartCurve.Straight |
ConnectGapsDraws the band straight across a missing value, instead of leaving a gap. | bool | false |
LowEach item's low end, such as d => d.Min: any number, or null for none (no range at that item). | Expression<Func<TItem, object?>> | Required |
HighEach item's high end, such as d => d.Max. | Expression<Func<TItem, object?>> | Required |
AggregateWith ChartDrillLevel<T>s, how each level adds up its items' values: DataAggregate.Sum (the default), DataAggregate.Avg, DataAggregate.Min, DataAggregate.Max or DataAggregate.Count (the items with a value). | DataAggregate | DataAggregate.Sum |
NameThe series' name, in the legend, the data table and each value's description. | string? | computed |
SeriesBySplits the series into one per value of this, such as p => p.Device: each draws only its own items' values, is named by its value, and takes the next color and marker, in the order the values first appear. | Expression<Func<TItem, object?>>? | |
ColorA CSS color, such as var(--ib-color-danger) or #0f766e. | string? | computed |
LabelsWrites each value beside its bar or point. | ChartLabels | ChartLabels.None |
LabelFormatA .NET format string for this series' labels, such as C0. | string? | computed |
LabelTextWhat each label says in place of its value, such as r => r.Region to name each bubble or point. | Expression<Func<TItem, object?>>? | |
LabelOverlapWhat labels do when they'd overlap others: left out at those widths (ChartLabelOverlap.Hide, the default), or shown anyway (ChartLabelOverlap.Show). | ChartLabelOverlap | ChartLabelOverlap.Hide |
TrendDraws a trend through the values: a dashed line in the series' color, named "Revenue trend" (a moving average "Revenue, 7-day average") in the legend, tooltips and data table. | ChartTrend | ChartTrend.None |
TrendOrderA polynomial trend's order, 2 (a parabola) to 6. | int | 2 |
TrendPeriodHow many values a moving average takes in, 2 or more. | int | 3 |
TrendColorThe trend's CSS color, such as var(--ib-color-danger), used as given. | string? | computed |
ValueAxisThe Name of the value axis the series is read off, for a measure in other units on a second axis at the end side, such as "margin". | string? | computed |
HiddenStarts with the series hidden: the chart is drawn as if it weren't there, and it keeps its place in the legend, to show it again, and in the data table. | bool | false |