Histogram
Show response-time distributions with explicit numeric bins.
Loading chart…
| Interval (ms) | Requests |
|---|---|
| [0, 40) | 12 |
| [40, 80) | 15 |
| [80, 120) | 5 |
| [120, 160) | 2 |
| [160, 200] | 2 |
Usage
Use binHistogram to prepare numeric bins for HistogramSeries.
<Chart.Root config={config}>
<Chart.ResponsiveContainer width="100%" height={280}>
<Chart.HistogramChart bins={result.bins} measure="count" animate accessibilityLayer>
<Chart.CartesianGrid vertical={false} />
<Chart.HistogramSeries />
<Chart.Tooltip />
</Chart.HistogramChart>
</Chart.ResponsiveContainer>
</Chart.Root>Bins include their lower edge; only the last bin includes its upper edge. Interior-edge samples go right. Accepted, missing, nonfinite and out-of-range samples are counted separately.
Count height shows observations; rectangle width is the numeric interval span.
Unequal-width density
Density is count / (accepted × bin width). Nonempty rectangle areas sum to one; heights need not. Empty totals yield zero density, and discarded samples do not enter normalization.
Loading chart…
| Interval (ms) | Requests | Probability per ms |
|---|---|---|
| [0, 25) | 3 | 0.003333333333333333 |
| [25, 50) | 15 | 0.016666666666666666 |
| [50, 100) | 12 | 0.006666666666666666 |
| [100, 200] | 6 | 0.0016666666666666666 |
Materials
Choose plain, paper, clay or glow. Numeric bounds stay fixed; custom shape, filter or style.filter owns paint.
Loading chart…
| Interval (ms) | Requests | Probability per ms |
|---|---|---|
| [0, 25) | 3 | 0.003333333333333333 |
| [25, 50) | 15 | 0.016666666666666666 |
| [50, 100) | 12 | 0.006666666666666666 |
| [100, 200] | 6 | 0.0016666666666666666 |
API reference
Use xAxisProps and yAxisProps for tick presentation; Histogram owns quantitative axes and geometry.
binHistogram
| Prop | Type | Default | Description |
|---|---|---|---|
samples | readonly (number | null | undefined)[] | Required | Raw observations; missing, nonfinite and out-of-range values are counted separately. |
edges | readonly number[] | Required | At least two finite, strictly increasing edges with finite positive widths. Invalid edges throw. |
Returns HistogramBinningResult: bins, accepted, missing, nonfinite and outOfRange. Each bin has lower, upper and count. No coercion or edge inference occurs.
Pre-aggregated bins may have gaps. Bounds must be ordered, nonoverlapping and finite with positive finite widths; counts and their total must be nonnegative safe integers.
HistogramChart
| Prop | Type | Default | Description |
|---|---|---|---|
bins | readonly HistogramBin[] | Required | Validated intervals; their first lower and final upper bounds define the horizontal domain. |
measure | "count" | "density" | Required | Count height or normalized probability density. Numerically unrepresentable density throws. |
animate | boolean | BarAnimation | false | Reuses chart-owned Bar entrance and reduced-motion handling. Options include revealDurationMs, revealEasing and hoverTransition. |
xAxisProps | Native XAxis presentation props | — | Ticks, tick formatting and spacing; numeric scale, domain, axis identity and bin midpoint are owned. |
yAxisProps | Native YAxis presentation props | — | Tick presentation; numeric domain is [0, "dataMax"]. |
accessibilityLayer | boolean | true in Recharts | Arrow-key inspection; set explicitly in these components. |
margin | { top?: number; right?: number; bottom?: number; left?: number } | 5 each side | Plot spacing. |
children | ReactNode | — | Explicit histogram series, grid and tooltip. |
Owns data, vertical layout, scales and spacing. See XAxis, YAxis and BarChart for presentation options.
HistogramSeries
| Prop | Type | Default | Description |
|---|---|---|---|
seriesKey | string | "count" | Root metadata and visibility identity; internal dataKey is owned. |
material | "plain" | "paper" | "clay" | "glow" | "plain" | Finish on corrected bin rectangles. |
shape | (props: HistogramShapeProps) => ReactElement | — | Native bar shape props with corrected numeric x, width and original bin; custom geometry becomes consumer-owned. |
fill / stroke | string | Config color / unset | Explicit paint overrides. |
hide | boolean | false | Hides the series; Root visibility also applies. |
Requires HistogramChart. Plain bins have square corners and no minimum height. Cells/events remain available; stacking, labels, background, activeBar, bar sizing and axis identity are excluded. See Recharts Bar.
Shared components
Root, SeriesConfig, Tooltip, Axes and grid, ResponsiveContainer.