Skip to content
IzzyBlazor

Enter all results ↑ ↓ move Esc close

Range bar chart

Since 0.1.0-alpha.23
Compares spans between two values, such as each day's low and high temperature.

Use range bars when the span between two values is the point, such as each day's low and high temperature. A range bar shows only the ends. When the spread between them matters, use a box plot. For a span over time, a range area chart reads better.

Range bars

ChartRangeBarSeries draws a bar from each item's Low to its High, here the average day's low and high temperature in each month.

Static

Preview

Average daily low and high, Chicago
Arrow keys move between values; Escape hides the tooltip.

Code

Usage.razor
@* Chicago's average daily low and high by month (1991–2020 normals, rounded): each bar spans the
   month's typical day, so the year's swing and each month's spread read together. *@
<Chart Items="_months" Argument="m => m.Month" Title="Average daily low and high, Chicago">
    <ChartValueAxis Format="0°C" />
    <ChartRangeBarSeries Low="m => m.Low" High="m => m.High" Name="Low to high" />
</Chart>

@code {
    private record Normal(string Month, int Low, int High);

    private readonly Normal[] _months =
    [
        new("Jan", -9, -1), new("Feb", -7, 1), new("Mar", -2, 8), new("Apr", 4, 15),
        new("May", 10, 21), new("Jun", 15, 27), new("Jul", 19, 29), new("Aug", 18, 28),
        new("Sep", 14, 24), new("Oct", 7, 17), new("Nov", 1, 9), new("Dec", -5, 2),
    ];
}

Add this example to a page with the izzy CLI:

bash
izzy add component ChartRangeBarSeries --at <file>:<line>

The value axis fits the ranges and needn't reach zero: a range bar's length is its spread, not an amount.

A missing Low or High leaves a gap at that item. With ChartDrillLevels, a level's bar runs from its items' lowest low to their highest high.

Range series don't stack, and take no Trend.

Bars across: a plan

With the chart's Orientation="Orientation.Horizontal", range bars lie across, each from its Low on the left to its High. Here each phase of a plan runs from its first week to its last, so overlaps between phases show at a glance.

Static

Preview

Website relaunch plan, Q1 2026
Arrow keys move between values; Escape hides the tooltip.

Code

RangeBarPlan.razor
@* A website relaunch, phase by phase from its first week to its last: bars across, so the phases
   read down in order and the weeks run left to right. *@
<Chart Items="_phases" Argument="p => p.Phase" Title="Website relaunch plan, Q1 2026" Orientation="Orientation.Horizontal">
    <ChartValueAxis Format="'Week '0" Min="0" Max="14" Step="2" />
    <ChartRangeBarSeries Low="p => p.Start" High="p => p.End" Name="Weeks" />
</Chart>

@code {
    private record PlanPhase(string Phase, int Start, int End);

    private readonly PlanPhase[] _phases =
    [
        new("Research", 0, 3),
        new("Design", 2, 6),
        new("Content", 4, 9),
        new("Build", 5, 11),
        new("Testing", 9, 12),
        new("Launch", 12, 13),
    ];
}

The value axis sets the weeks' scale: Min, Max and Step on ChartValueAxis, and a Format that writes each tick as a week.

The values are numbers. To plan by date, give each phase its start and end as a count of days or weeks from the plan's start.

Details

Bars stand upright, or lie across with the chart's Orientation="Orientation.Horizontal". The value axis needn't start at zero: a range bar's length is the spread, not the amount.

Mode support

What works in each mode, Range bar chart
FeatureStaticInteractive
Bars from each item's low to its high, upright or acrossYesYes
A value axis that fits the ranges, not drawn down to zeroYesYes
Each range read low first, such as "1°C – 9°C", in tooltips, labels and the tableYesYes
Legend items that hide and show a rangeYesYes
A table of the values behind a "Show data" buttonYesYes
Tooltips on hover and from the keyboardYesYes

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 a range: waits for the script
  • Tooltips on hover and from the keyboard: waits for the script

Parameters

ChartRangeBarSeries parameters
PropTypeDefault
OpacityHow solid the bars are, from 0 (the surface's color) to 1 (the series color).double?computed
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).DataAggregateDataAggregate.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.ChartLabelsChartLabels.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).ChartLabelOverlapChartLabelOverlap.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.ChartTrendChartTrend.None
TrendOrderA polynomial trend's order, 2 (a parabola) to 6.int2
TrendPeriodHow many values a moving average takes in, 2 or more.int3
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.boolfalse

Connection lost

Rejoining the server…