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.
Code
<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.
Code
<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" } ] }