Lines and areas

Line and area charts for time series in Blazor: three curve shapes, gaps for missing values, and areas that start at zero. The x axis can also be plain numbers.

Curves

Linear (default), Monotone (smooth, never overshoots the data) and Step (each value holds until the next point, for limits, prices and states). Here web sessions, and the server capacity that is scaled up for the day and down at night.

Chart "Monotone" with 1 series. Web sessions: 192 values, lowest 28 at 11/17/2026 7:45 AM, highest 252 at 11/16/2026 8:00 PM, trend stable. Monotone0100200300Nov 1612:00 PMNov 1712:00 PMUse Left and Right to move between points. Press Escape to leave.
Chart "Step" with 1 series. Capacity: 8 values, lowest 200 at 11/16/2026 12:00 AM, highest 400 at 11/16/2026 4:00 PM, trend stable. Step200300400Nov 1612:00 PMNov 1712:00 PMNov 18Use Left and Right to move between points. Press Escape to leave.
Code
Razor
<LineSeries Items="web" Name="Web sessions" XValue="r => r.Time" YValue="r => r.Value" Curve="CurveType.Monotone" />
<LineSeries Items="capacity" Name="Capacity" XValue="r => r.Time" YValue="r => r.Value" Curve="CurveType.Step" />

Gaps

A null y value breaks the line instead of dropping to zero: here the conversion rate is missing for a few hours while tracking was down. A point with no neighbour gets a small dot so it stays visible.

Chart with 1 series. Conversion: 177 values, lowest 1.73 % at 11/17/2026 7:30 AM, highest 3.56 % at 11/16/2026 8:45 PM, trend rising. 1234Nov 166:00 AM12:00 PM6:00 PMNov 176:00 AM12:00 PM6:00 PM%Use Left and Right to move between points. Press Escape to leave.
Code
Razor
<RioChart Items="conversion" YAxis="@(new AxisOptions { Title = "%" })">
    <LineSeries Name="Conversion" XValue="r => r.Time" YValue="r => r.Value" Format="0.00 '%'" />  @* Value is double? *@
</RioChart>

Irregular time series

Points are placed at their real times, so series do not need a fixed interval or the same timestamps, and the items need not be sorted: the chart sorts numbers and times by x itself (clicks and tooltips still give the right item). Here the stock of a product is logged only when it has moved by 3 items, or after an hour without a reading (53 readings: many while it sells fast and when a delivery comes in, few at night), and the reorder level is a step line that changes at irregular times. Hover a stock reading: the tooltip also lists the reorder level in effect at that moment, marked on the step line at the point where that level was set.

A long silence is not a gap by itself: the warehouse system was offline 13:10–15:05 and the line simply joins the readings on either side. To break the line, add a reading with a null value where the data stops (see Gaps above).

Chart with 2 series. Stock: 53 values, lowest 39 in stock at 11/16/2026 8:59 PM, highest 120 in stock at 11/16/2026 12:00 AM, trend falling. Reorder level: 7 values, lowest 40 at 11/16/2026 12:00 AM, highest 80 at 11/16/2026 9:45 AM, trend falling. 050100150Nov 163:00 AM6:00 AM9:00 AM12:00 PM3:00 PM6:00 PM9:00 PMNov 17ItemsStockReorder levelUse Left and Right to move between points, Up and Down to change series. Press Escape to leave.
Code
Razor
@* Readings logged on change: no fixed interval, different timestamps per series. *@
<RioChart TItem="Reading" YAxis="@(new AxisOptions { Title = "Items" })">
    <LineSeries Items="stock" Name="Stock" XValue="r => r.Time" YValue="r => r.Value" Format="0 'in stock'" />
    <LineSeries Items="reorderLevel" Name="Reorder level" XValue="r => r.Time" YValue="r => r.Value" Format="0" Curve="CurveType.Step" />
</RioChart>

Dots on the points

Lines hide their points until hovered. With few readings, Highlight="PointHighlight.All" puts a dot on every point, so it is clear where the values are and where the line only joins them. MarkerSize sets the dot's diameter. Other PointHighlight values mark single points: first, last, lowest and highest (combine with |). Beyond 1000 visible points All draws no dots. In JSON definitions: "highlight": "all".

Chart with 1 series. Response time: 7 values, lowest 171 ms at 11/20/2026 12:00 AM, highest 305 ms at 11/21/2026 12:00 AM, trend rising. 100200300400Nov 16Nov 17Nov 18Nov 19Nov 20Nov 21Nov 22Response time, msUse Left and Right to move between points. Press Escape to leave.
Code
Razor
<RioChart TItem="Reading">
    <LineSeries Items="checks" Name="Response time" XValue="r => r.Time" YValue="r => r.Value" Highlight="PointHighlight.All" />
</RioChart>

Dashed and dotted lines

Dash="LineDash.Dashed" or LineDash.Dotted tells a forecast, plan or target apart from the actual values, also without color. The pattern scales with StrokeWidth and the legend shows it too. On an AreaSeries it dashes the top line and keeps the fill. Here the orders of the last weeks, a dashed forecast for the next two and a dotted target. In JSON definitions: "dash": "dashed".

Chart with 3 series. Orders: 35 values, lowest 159 at 11/2/2026 12:00 AM, highest 290 at 10/18/2026 12:00 AM, trend falling. Forecast: 15 values, lowest 202 at 11/30/2026 12:00 AM, highest 280 at 11/18/2026 12:00 AM, trend falling. Target: 2 values, lowest 250 at 10/13/2026 12:00 AM, highest 250 at 10/13/2026 12:00 AM, trend stable. 150200250300Oct 19Oct 26Nov 2Nov 9Nov 16Nov 23Nov 30OrdersForecastTargetUse Left and Right to move between points, Up and Down to change series. Press Escape to leave.
Code
Razor
<RioChart TItem="Reading">
    <LineSeries Items="orders" Name="Orders" XValue="r => r.Time" YValue="r => r.Value" />
    <LineSeries Items="forecast" Name="Forecast" XValue="r => r.Time" YValue="r => r.Value" Dash="LineDash.Dashed" />
    <LineSeries Items="target" Name="Target" XValue="r => r.Time" YValue="r => r.Value" Dash="LineDash.Dotted" />
</RioChart>

Numbers on the x axis

The x values do not have to be times: when XValue returns a number, the x axis is a linear number axis with nice ticks, and everything else works the same (curves, gaps, zoom, the tooltip, reference lines). Here a load test: the response time at each step from 10 to 500 concurrent users. The 95th percentile stays under the 120 ms limit up to about 350 users, then climbs steeply as the servers saturate. XAxis takes a title and a Format for the tick labels, and the vertical ReferenceLine with Axis="AnnotationAxis.X" marks the expected peak load.

Chart with 2 series. Median: 50 values, lowest 37 ms at 60, highest 105 ms at 500, trend rising. 95th percentile: 50 values, lowest 64 ms at 70, highest 297 ms at 500, trend rising. 010020030050100150200250300350400450500Concurrent usersResponse time, msMedian95th percentileLimit: 120LimitExpected peak: 300Expected peakUse Left and Right to move between points, Up and Down to change series. Press Escape to leave.
Code
Razor
@* public record LoadStep(double Users, double MedianMs, double P95Ms); *@
<RioChart Items="loadTest" XAxis="@(new AxisOptions { Title = "Concurrent users", Format = "0" })"
          YAxis="@(new AxisOptions { Title = "Response time, ms" })">
    <LineSeries Name="Median" XValue="s => s.Users" YValue="s => s.MedianMs" Format="0 ms" Curve="CurveType.Monotone" />
    <LineSeries Name="95th percentile" XValue="s => s.Users" YValue="s => s.P95Ms" Format="0 ms" Curve="CurveType.Monotone" />
    <ReferenceLine Value="120" Label="Limit" />
    <ReferenceLine Axis="AnnotationAxis.X" Value="300" Label="Expected peak" />
</RioChart>

Areas

Areas always include zero, with a light fill under the line.

Chart with 1 series. Revenue: 192 values, lowest 42 € at 11/17/2026 8:00 AM, highest 1,709 € at 11/16/2026 6:15 PM, trend stable. 01k2kNov 166:00 AM12:00 PM6:00 PMNov 176:00 AM12:00 PM6:00 PM€ per 15 minUse Left and Right to move between points. Press Escape to leave.
Code
Razor
<RioChart Items="revenue" YAxis="@(new AxisOptions { Title = "€ per 15 min" })">
    <AreaSeries Name="Revenue" XValue="r => r.Time" YValue="r => r.Value" Format="#,0 €" Curve="CurveType.Monotone" />
</RioChart>

Negative values

Values below zero need nothing extra: the y axis takes in the lowest value and zero, and an area fills from zero up or down. Here the net cash flow per day: sales bring money in every day, supplier invoices on the 1st and 15th and wages on the 25th take it out. A ColorBands entry with Below = 0 colors the outflow red, line and fill, exactly where the line crosses zero.

Chart with 1 series. Net cash flow: 42 values, lowest −42.1 k€ at 10/25/2026 12:00 AM, highest +13.6 k€ at 10/4/2026 12:00 AM, trend stable. -60-40-20020Oct 5Oct 12Oct 19Oct 26Nov 2Nov 9k€ per dayUse Left and Right to move between points. Press Escape to leave.
Code
Razor
<RioChart Items="netCashFlow" YAxis="@(new AxisOptions { Title = "k€ per day" })">
    <AreaSeries Name="Net cash flow" XValue="r => r.Time" YValue="r => r.Value" Format="+#,0.0 k€;−#,0.0 k€;0 k€"
                ColorBands="@([new ColorBand { Below = 0, Color = "--rio-negative" }])" />
</RioChart>

Colors by value

ColorBands colors a line by its value: here response times turn red above 120 ms, exactly where the line crosses the limit, also between two readings. Bands take Above, Below or both; later bands win where they overlap. On areas the fill follows, on bars and scatter points each one takes the color of its band, and the tooltip dot matches. In JSON definitions: "colorBands": [{ "above": 120, "color": "--rio-negative" }].

Chart with 1 series. Checkout: 192 values, lowest 65 ms at 11/17/2026 2:00 AM, highest 132 ms at 11/17/2026 6:45 PM, trend rising. 50100150Nov 166:00 AM12:00 PM6:00 PMNov 176:00 AM12:00 PM6:00 PMResponse time, msLimit: 120LimitUse Left and Right to move between points. Press Escape to leave.
Code
Razor
<RioChart Items="responseTimes">
    <LineSeries Name="Checkout" XValue="r => r.Time" YValue="r => r.Value" Format="0 ms"
                ColorBands="@([new ColorBand { Above = 120, Color = "--rio-negative" }])" />
    <ReferenceLine Value="120" Label="Limit" />
</RioChart>

Stacked areas

Series with the same Stack name are stacked: sessions by channel add up to the total. Hide one in the legend and the stack closes up.

Chart with 3 series. Search: 192 values, lowest 15 at 11/16/2026 7:15 AM, highest 141 at 11/16/2026 8:00 PM, trend rising. Social: 192 values, lowest 2 at 11/16/2026 6:30 AM, highest 89 at 11/17/2026 8:00 PM, trend rising. Email: 192 values, lowest 7 at 11/16/2026 6:00 AM, highest 58 at 11/16/2026 9:45 AM, trend stable. 0100200300Nov 166:00 AM12:00 PM6:00 PMNov 176:00 AM12:00 PM6:00 PMSessions per 15 minSearchSocialEmailUse Left and Right to move between points, Up and Down to change series. Press Escape to leave.
Code
Razor
<RioChart TItem="Reading" YAxis="@(new AxisOptions { Title = "Sessions per 15 min" })">
    <AreaSeries Items="search" Name="Search" XValue="r => r.Time" YValue="r => r.Value" Stack="channels" />
    <AreaSeries Items="social" Name="Social" XValue="r => r.Time" YValue="r => r.Value" Stack="channels" />
    <AreaSeries Items="email" Name="Email" XValue="r => r.Time" YValue="r => r.Value" Stack="channels" />
</RioChart>

Range areas

RangeAreaSeries fills a band between a low and a high value per x: here the lowest and highest revenue on each date over the last three years, around the average line. The tooltip shows "low – high". In a JSON definition it is "type": "rangeArea" with "low" and "y" fields; with timeBucket the band keeps the lowest low and highest high.

Chart with 2 series. Last 3 years: 42 values, lowest 10,479 € at 10/8/2026 12:00 AM, highest 16,897 € at 11/14/2026 12:00 AM, trend rising. Average: 42 values, lowest 8,921 € at 10/9/2026 12:00 AM, highest 14,360 € at 11/15/2026 12:00 AM, trend rising. 5k10k15k20kOct 5Oct 12Oct 19Oct 26Nov 2Nov 9Revenue per dayLast 3 yearsAverageUse Left and Right to move between points, Up and Down to change series. Press Escape to leave.
Code
Razor
<RioChart Items="revenueHistory" YAxis="@(new AxisOptions { Title = "Revenue per day" })">
    <RangeAreaSeries Name="Last 3 years" XValue="d => d.Date" LowValue="d => d.Low" HighValue="d => d.High"
                     Format="#,0 €" Curve="CurveType.Monotone" />
    <LineSeries Name="Average" XValue="d => d.Date" YValue="d => d.Average" Format="#,0 €" Curve="CurveType.Monotone" />
</RioChart>

Edge cases

Empty data, a single point and all-equal values each render a clean state, never an error or a collapsed axis.

Chart "Empty" with 1 series. No data available. EmptyNo data available
Chart "One point" with 1 series. series-1: 1 value, lowest 120 at 11/16/2026 12:00 AM, highest 120 at 11/16/2026 12:00 AM. One point10012014011:00 PMNov 161:00 AMUse Left and Right to move between points. Press Escape to leave.
Chart "All equal" with 1 series. series-1: 24 values, lowest 200 at 11/16/2026 12:00 AM, highest 200 at 11/16/2026 12:00 AM, trend stable. All equal180200220Nov 1612:00 PMUse Left and Right to move between points. Press Escape to leave.
Code
Razor
<RioChart TItem="Reading" Title="Empty"><LineSeries Items="empty" ... /></RioChart>
<RioChart TItem="Reading" Title="One point"><LineSeries Items="one" ... /></RioChart>
<RioChart TItem="Reading" Title="All equal"><LineSeries Items="flat" ... /></RioChart>
An unhandled error has occurred. Reload 🗙