Range bars and timelines

Timelines and Gantt charts: a range bar runs from a start to an end on a time axis, in a row of its own. What each machine was doing through a shift, or when each task of a project starts and ends.

States over time

Give RangeBarSeries a StartValue and an EndValue (DateTime, DateTimeOffset, DateOnly or numbers) and a RowValue. Rows are listed in the order they first appear. Series share the rows, so a state timeline is one series per state, each with its own color and legend entry. The tooltip shows the row, the start, the end and the duration; a ReferenceLine on the x axis marks a time such as now.

Chart "Packing line" with 3 series. Running: 7 bars in 4 rows, from 3/2/2026 6:00 AM to 3/2/2026 1:00 PM. Idle: 3 bars in 2 rows, from 3/2/2026 6:00 AM to 3/2/2026 1:00 PM. Stopped: 2 bars in 2 rows, from 3/2/2026 9:30 AM to 3/2/2026 11:45 AM. Packing line6:00 AM7:00 AM8:00 AM9:00 AM10:00 AM11:00 AM12:00 PM1:00 PMFillerCapperLabelerPalletizerRunningIdleStoppedNowUse Left and Right to move between points, Up and Down to change series. Plus and minus zoom, Shift with Left and Right pans, 0 shows all data. Press Escape to leave.
Code
Razor
<RioChart TItem="Period" Title="Packing line" Zoomable="true">
    <RangeBarSeries Name="Running" Items="running" RowValue="p => p.Machine" StartValue="p => p.From" EndValue="p => p.To" Color="--rio-positive" />
    <RangeBarSeries Name="Idle" Items="idle" RowValue="p => p.Machine" StartValue="p => p.From" EndValue="p => p.To" Color="--rio-text-muted" />
    <RangeBarSeries Name="Stopped" Items="stopped" RowValue="p => p.Machine" StartValue="p => p.From" EndValue="p => p.To" Color="--rio-negative" />
    <ReferenceLine Axis="AnnotationAxis.X" Value="now" Label="Now" />
</RioChart>

@code {
    record Period(string Machine, string State, DateTime From, DateTime To);
}

A project schedule

One row per task: RowValue is the task, and ColorValue colors each bar by its phase. Dates work as well as times. DataLabels writes each bar's duration in it where it fits. A task without an end is listed but not drawn. Dependencies, dragging and editing are not part of RioCharts.

Chart with 1 series. Tasks: 6 bars in 6 rows, from 3/2/2026 to 4/24/2026. Mar 2Mar 9Mar 16Mar 23Mar 30Apr 6Apr 13Apr 20InterviewsContent planDesignBuildContentTestingLaunchEaster7 d10 d15 d25 d21 d11 dUse Left and Right to move between points. Press Escape to leave.
Code
Razor
<RioChart TItem="ProjectTask" Items="tasks">
    <RangeBarSeries Name="Tasks" RowValue="t => t.Name" StartValue="t => t.Start" EndValue="t => t.End"
                    ColorValue='t => t.Phase == "Plan" ? "--rio-series-2" : null' DataLabels="true" />
    <ReferenceBand Axis="AnnotationAxis.X" From="new DateOnly(2026, 4, 3)" To="new DateOnly(2026, 4, 7)" Label="Easter" />
</RioChart>

@code {
    record ProjectTask(string Name, string Phase, DateOnly Start, DateOnly? End);
}

In JSON definitions

"type": "rangeBar" (also timeline and gantt) with "start" and "end" fields (times or numbers) and a "row" field. groupBy makes one series per value, e.g. per state:

{ "dataset": "line", "series": [ { "type": "timeline", "row": "machine", "start": "from", "end": "to", "groupBy": "state" } ] }
An unhandled error has occurred. Reload 🗙