Axes and time

Axes are picked from the data: ticks fall on nice numbers or calendar boundaries, and labels follow the culture. A chart can have several y axes.

Time ticks that follow the range

Ticks land on calendar boundaries: midnights, Mondays, the 1st of the month, 1 January. The densest set whose labels fit is used, so a narrow chart gets fewer ticks.

Chart "Two days" with 1 series. Sessions: 192 values, lowest 28 at 11/17/2026 7:45 AM, highest 252 at 11/16/2026 8:00 PM, trend stable. Two days0200400Nov 1612:00 PMNov 1712:00 PMUse Left and Right to move between points. Press Escape to leave.
Chart "Five weeks" with 1 series. Orders: 35 values, lowest 159 at 11/2/2026 12:00 AM, highest 290 at 10/18/2026 12:00 AM, trend falling. Five weeks100200300Oct 19Oct 26Nov 2Nov 9Nov 16Use Left and Right to move between points. Press Escape to leave.
Code
Razor
<RioChart Items="sessions" Title="Two days">
    <LineSeries XValue="r => r.Time" YValue="r => r.Value" />
</RioChart>

Two Y axes

Extra axes go on the right (or left, with Position = AxisPosition.Left); series pick one with YAxisId. Their ticks line up with the main grid. Several axes on one side sit side by side, each under its own title. SeriesColor = true colors the labels and title of an axis like its series, so it is clear which axis belongs to which line (or set Color). Here sessions per hour on the left and the orders they turn into on the right.

Chart with 2 series. Orders: 48 values, lowest 2 orders at 11/16/2026 9:00 AM, highest 28 orders at 11/16/2026 8:00 PM, trend stable. Sessions: 48 values, lowest 116 sessions at 11/17/2026 8:00 AM, highest 998 sessions at 11/16/2026 8:00 PM, trend stable. 00.2k0.4k0.6k0.8k1k01020304050Nov 166:00 AM12:00 PM6:00 PMNov 176:00 AM12:00 PM6:00 PMSessions per hourOrdersOrdersSessionsUse 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 hour", SeriesColor = true })"
          YAxes="@([new AxisOptions { Id = "orders", Title = "Orders", SeriesColor = true }])">
    <BarSeries Items="orders" Name="Orders" XValue="r => r.Time" YValue="r => r.Value" YAxisId="orders" />
    <LineSeries Items="sessions" Name="Sessions" XValue="r => r.Time" YValue="r => r.Value" />
</RioChart>

Formats and fixed ranges

Set Format (any .NET format string) and Min/Max on an axis; Culture on the chart.

Diagramm mit 1 Reihe. 2026: 4 Werte, Minimum 214.000 € bei Q1, Maximum 305.000 € bei Q4. 0 €100.000 €200.000 €300.000 €400.000 €Q1Q2Q3Q4EURMit Links und Rechts zwischen Punkten wechseln. Escape verlässt das Diagramm.
Code
Razor
<RioChart TItem="Sales" Culture="CultureInfo.GetCultureInfo("de-DE")"
       YAxis="@(new AxisOptions { Title = "EUR", Format = "C0", Min = 0 })">
    <BarSeries Items="quarters" Name="2026" XValue="s => s.Quarter" YValue="s => s.ThisYear" />
</RioChart>

Labels from a function

When a format string is not enough, e.g. bytes that pick KB, MB or GB themselves, give the axis a LabelFormatter. It writes the tick labels, and the tooltips and data labels of series without a Format of their own, so the values can stay in bytes. Ticks stay on round steps. A series' Format falls back to its axis' format or function; the axis never takes the series' format. For units of 1024, set TickBase = 1024 too: the steps are then round in KB, MB or GB (20 MB, 40 MB) instead of round in bytes (47.7 MB, 95.4 MB).

Chart with 1 series. Transferred: 48 values, lowest 123.7 MB at 11/16/2026 3:00 AM, highest 4.3 GB at 11/17/2026 2:00 PM, trend stable. 0 B2 GB4 GB6 GBNov 166:00 AM12:00 PM6:00 PMNov 176:00 AM12:00 PM6:00 PMPer hourUse Left and Right to move between points. Press Escape to leave.
Code
Razor
<RioChart Items="transfer" YAxis="@(new AxisOptions { Title = "Per hour", LabelFormatter = Bytes, TickBase = 1024 })">
    <AreaSeries Name="Transferred" XValue="r => r.Time" YValue="r => r.Value" />   @* Value in bytes *@
</RioChart>

@code {
    static string Bytes(double v)
    {
        string[] units = ["B", "KB", "MB", "GB", "TB"];
        var unit = 0;
        while (Math.Abs(v) >= 1024 && unit < units.Length - 1)
        {
            v /= 1024;
            unit++;
        }

        return $"{v:0.#} {units[unit]}";
    }
}

Category labels

Category labels that do not fit side by side slope at 45 degrees, so every bar keeps its name; long names are shortened with "…" (the tooltip has the full name). Set LabelRotation on the x axis for another angle (0 to 90), or LabelRotation = 0 to keep them horizontal and show every n-th. In JSON definitions: "x": { "labelRotation": 45 }.

Chart with 1 series. Sign-ups: 18 values, lowest 144 at Greece, highest 4,200 at Germany. 02k4k6kGermanyFranceUnited KingdomSpainItalyNetherlandsPolandSwedenBelgiumAustriaSwitzerlandDenmarkNorwayFinlandPortugalIrelandCzech RepublicGreeceUse Left and Right to move between points. Press Escape to leave.

Code
Razor
@* Labels that do not fit slope at 45 degrees. XAxis="@(new AxisOptions { LabelRotation = 0 })" keeps them horizontal. *@
<RioChart Items="signupsByCountry">
    <BarSeries Name="Sign-ups" XValue="c => c.Name" YValue="c => c.Value" Format="#,0" />
</RioChart>

Logarithmic axis

For values that span several powers of ten, Scale = ScaleType.Log on a y axis gives equal ratios equal distances: 10 to 100 is as tall as 100k to 1M. Here the visits per page in a month: on a linear axis the start page flattens everything else, on a log axis every page can be read. Ticks are powers of ten (with 2 and 5 between them when the range is short); bars start at the bottom of the axis. Zero and negative values have no place on a log axis: they are left out, with a warning. In JSON definitions: "y": { "scale": "log" }.

Chart with 1 series. Visits: 8 values, lowest 37 at Old campaign, highest 1,240,000 at Start. 101001k10k100k1M10MStartSearchRunning shoesRain jacketSize guideBlog postCareersOld campaignVisits per month1,240,000386,00092,40018,7006,1501,83041237Use Left and Right to move between points. Press Escape to leave.

Code
Razor
<RioChart Items="pageVisits" YAxis="@(new AxisOptions { Title = "Visits per month", Scale = ScaleType.Log })">
    <BarSeries Name="Visits" XValue="p => p.Name" YValue="p => p.Value" Format="#,0" DataLabels="true" />
</RioChart>

Logarithmic on both axes

The x axis takes Scale = ScaleType.Log too, for numbers under lines, areas and scatter points (bars need even spacing, so their x axis stays linear, with a warning). Log on both axes, a power law such as load time against page size becomes a straight line. Points at x zero or below are left out, x lines and bands are placed by ratio, and zoom and pan keep ratios: drag to zoom, Shift-drag to pan. In JSON definitions: "x": { "scale": "log" }.

Chart with 1 series. Pages: 40 values, lowest 168 ms at 14.1, highest 11,633 ms at 8,414, trend rising. 1001k10k100k1020501002005001k2k5k10kPage size, kBLoad time, ms1 MB: 1,0001 MBUse Left and Right to move between points. Plus and minus zoom, Shift with Left and Right pans, 0 shows all data. Press Escape to leave.
Code
Razor
<RioChart Items="pageLoads" Zoomable="true"
          XAxis="@(new AxisOptions { Title = "Page size, kB", Scale = ScaleType.Log })"
          YAxis="@(new AxisOptions { Title = "Load time, ms", Scale = ScaleType.Log })">
    <ScatterSeries Name="Pages" XValue="p => p.SizeKb" YValue="p => p.Ms" Format="#,0 'ms'" />
</RioChart>

Display time zone

By default times are shown exactly as given. With TimeZone ("UTC", "local" for the visitor's zone, or an IANA id), times are plotted on instants and labelled in that zone, so a line runs straight through the repeated hour when summer time ends. Tooltips show the offset when it differs from yours. TooltipFormat on the x axis sets the tooltip's time format instead (e.g. "d MMM HH:mm", without seconds), with no offset added; the axis labels keep theirs.

Chart with 1 series. Orders: 36 values, lowest 10 orders at 10/24/2026 4:00 PM, highest 70 orders at 10/25/2026 3:00 AM, trend stable. 0501006:00 PMOct 256:00 AM12:00 PM6:00 PMOct 26Orders per hourUse Left and Right to move between points. Press Escape to leave.

Zone:

Code
Razor
<RioChart Items="orders" TimeZone="Europe/Stockholm">   @* Time is a DateTimeOffset *@
    <LineSeries XValue="m => m.Time" YValue="m => m.Value" />
</RioChart>

Time buckets in the display zone

With a TimeZone, Bucket groups on the calendar of that zone: a day runs from midnight to midnight there, weeks start on Monday there, and a day with a daylight saving change is 23 or 25 hours long. The same orders, stored in UTC, give other daily totals in New York or Tokyo. Without a zone, buckets use the times as given. JSON definitions do the same with "timeZone" and "timeBucket".

Chart with 1 series. Orders: 5 values, lowest 14 orders at 11/15/2026 12:00 AM, highest 394 orders at 11/18/2026 12:00 AM, trend rising. 0200400600Nov 15Nov 16Nov 17Nov 18Nov 19Orders per day14 orders298 orders346 orders394 orders388 ordersUse Left and Right to move between points. Press Escape to leave.

Zone:

Code
Razor
<RioChart Items="orders" TimeZone="America/New_York">   @* Time is a DateTimeOffset in UTC *@
    <BarSeries XValue="m => m.Time" YValue="m => m.Value" Bucket="TimeBucket.Day" Aggregate="Aggregate.Sum" />
</RioChart>
An unhandled error has occurred. Reload 🗙