Annotations

Mark what matters on a chart: target lines, campaign periods, maintenance windows and events. Muted by default, so they support the data.

Lines, bands, points and callouts

Reference lines expand the axis so they are always visible; bands do not. Values can be numbers, times or category names. Here an evening sale and a night-time maintenance window are bands on the time axis, the traffic target is a line, and the peak and the newsletter are marked on the data. Hover an annotation for its value.

Chart with 2 series. Web: 192 values, lowest 28 at 11/17/2026 7:45 AM, highest 252 at 11/16/2026 8:00 PM, trend stable. App: 192 values, lowest 13 at 11/16/2026 7:45 AM, highest 165 at 11/17/2026 7:45 PM, trend rising. 0100200300Nov 166:00 AM12:00 PM6:00 PMNov 176:00 AM12:00 PM6:00 PMSessions per 15 minWebAppEvening sale: 11/16/2026 4:00 PM – 11/16/2026 11:00 PMEvening saleMaintenance: 11/17/2026 2:00 AM – 11/17/2026 4:00 AMMaintenanceTarget: 200TargetNow: 11/17/2026 8:00 PMNowPeak: 252 sessions: 11/16/2026 8:00 PM, 252Peak: 252 sessionsNewsletter sent: 11/17/2026 7:00 AM, 34Newsletter sentUse Left and Right to move between points, Up and Down to change series. Press Escape to leave.

Clicked: nothing yet (click an annotation)

Code
Razor
<RioChart TItem="Reading" YAxis="@(new AxisOptions { Title = "Sessions per 15 min" })" OnAnnotationClick="e => clicked = e.Label">
    <ReferenceLine Value="200" Label="Target" />
    <ReferenceBand Axis="AnnotationAxis.X" From="saleStart" To="saleEnd" Label="Evening sale" />
    <ReferenceBand Axis="AnnotationAxis.X" From="maintenanceStart" To="maintenanceEnd" Label="Maintenance" Color="#d9480f" />
    <ReferenceLine Axis="AnnotationAxis.X" Value="now" Label="Now" />
    <PointAnnotation X="peak" Y="252" Label="Peak: 252 sessions" Color="#d9480f" />
    <Callout X="newsletterSent" Y="34" Label="Newsletter sent" OffsetX="-30" OffsetY="-36" />
    <LineSeries ... />
</RioChart>

Draggable threshold

With Draggable, the user can move a reference line; @bind-Value receives the new value. Here it sets when to send a high-traffic alert.

Chart with 1 series. Web: 192 values, lowest 28 at 11/17/2026 7:45 AM, highest 252 at 11/16/2026 8:00 PM, trend stable. 0100200300Nov 166:00 AM12:00 PM6:00 PMNov 176:00 AM12:00 PM6:00 PMSessions per 15 minAlert at 220 sessions: 220Alert at 220 sessionsUse Left and Right to move between points. Press Escape to leave.

Alert at 220 sessions per 15 min. Drag the dashed line.

Code
Razor
<ReferenceLine @bind-Value="alertAt" Label="Alert" Draggable="true" />

@code { double alertAt = 220; }

Pins: click a point to add one, click the pin to remove it

OnPointClick gives the item behind a point, so pinning it is a PointAnnotation at its x and y. With OnAnnotationClick set, point annotations and callouts are buttons: a click on the pin (its marker or label) raises OnAnnotationClick even though the pin sits on a data point, so removing a pin is a click on the pin.

Chart with 1 series. Orders: 35 values, lowest 159 orders at 11/2/2026 12:00 AM, highest 290 orders at 10/18/2026 12:00 AM, trend falling. 150200250300Oct 19Oct 26Nov 2Nov 9Nov 16Orders per dayUse Left and Right to move between points. Press Enter to select a point, Escape to leave.

Click a point to pin it.

Code
Razor
<RioChart TItem="Reading" Items="orders" OnPointClick="Pin" OnAnnotationClick="Unpin">
    <LineSeries Name="Orders" XValue="r => r.Time" YValue="r => r.Value" />
    @foreach (var pin in pins)
    {
        <PointAnnotation @key="pin.Time" Id="@PinId(pin)" X="pin.Time" Y="pin.Value ?? 0" Label="@($"{pin.Value:0}")" />
    }
</RioChart>

@code {
    List<Reading> pins = [];
    static string PinId(Reading r) => "pin-" + r.Time.Ticks;
    void Pin(PointClickEventArgs<Reading> e) { if (e.Item is { } item && !pins.Contains(item)) pins.Add(item); }
    void Unpin(AnnotationClickEventArgs e) => pins.RemoveAll(p => PinId(p) == e.AnnotationId);
}
An unhandled error has occurred. Reload 🗙