Histogram

A histogram shows how values are distributed: how many requests took 100 to 110 ms, how many 110 to 120. The values are counted in bins of equal width, drawn as bars that touch.

Response times

Give HistogramSeries one item per value, with the value as XValue. The bins get round edges: a width of 1, 2 or 5 times a power of ten, picked from the data when BinWidth and BinCount are not set. BinCount asks for about that many bins. The tooltip shows each bin's range and count, and a click gives the bin's items.

Chart with 1 series. Requests: 600 values, most from 140 to 150. 050100100150200250300msRequestsUse Left and Right to move between points. Press Escape to leave.

Code
Razor
<RioChart TItem="Request" Items="requests" XAxis="ms" YAxis="requests">
    <HistogramSeries Name="Requests" XValue="r => r.Ms" />
</RioChart>

@code {
    record Request(double Ms);

    AxisOptions ms = new() { Title = "ms" };
    AxisOptions requests = new() { Title = "Requests" };
}

Before and after

Several histograms on one chart overlay, see-through, so the shapes can be compared. Give them the same BinWidth: each one picks its own width from its data otherwise, and the bins would not line up.

Chart with 2 series. Before: 600 values, most from 140 to 150. After: 600 values, most from 120 to 130. 050100150100150200250300msRequestsBeforeAfterUse Left and Right to move between points, Up and Down to change series. Press Escape to leave.
Code
Razor
<RioChart TItem="Request" XAxis="ms" YAxis="requests">
    <HistogramSeries Name="Before" Items="before" XValue="r => r.Ms" BinWidth="10" />
    <HistogramSeries Name="After" Items="after" XValue="r => r.Ms" BinWidth="10" />
</RioChart>

In JSON definitions

"type": "histogram" with the numeric field to count as x (no y: the count is the value), and "binWidth" or "binCount" if wanted. With groupBy, every group gets the same bins.

An unhandled error has occurred. Reload 🗙