Components

Histogram

Show response-time distributions with explicit numeric bins.

Loading chart…

Response-time bins in milliseconds; [ includes an edge and ) excludes it. 36 accepted, 1 missing, 0 nonfinite, 1 out of range.
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.

Composition
<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…

Response-time density; [ includes an edge and ) excludes it. 36 accepted, 1 missing, 0 nonfinite, 1 out of range.
Interval (ms)RequestsProbability per ms
[0, 25)30.003333333333333333
[25, 50)150.016666666666666666
[50, 100)120.006666666666666666
[100, 200]60.0016666666666666666

Materials

Choose plain, paper, clay or glow. Numeric bounds stay fixed; custom shape, filter or style.filter owns paint.

Loading chart…

Response-time density; [ includes an edge and ) excludes it. 36 accepted, 1 missing, 0 nonfinite, 1 out of range.
Interval (ms)RequestsProbability per ms
[0, 25)30.003333333333333333
[25, 50)150.016666666666666666
[50, 100)120.006666666666666666
[100, 200]60.0016666666666666666

API reference

Use xAxisProps and yAxisProps for tick presentation; Histogram owns quantitative axes and geometry.

binHistogram

PropTypeDefaultDescription
samplesreadonly (number | null | undefined)[]RequiredRaw observations; missing, nonfinite and out-of-range values are counted separately.
edgesreadonly number[]RequiredAt 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

PropTypeDefaultDescription
binsreadonly HistogramBin[]RequiredValidated intervals; their first lower and final upper bounds define the horizontal domain.
measure"count" | "density"RequiredCount height or normalized probability density. Numerically unrepresentable density throws.
animateboolean | BarAnimationfalseReuses chart-owned Bar entrance and reduced-motion handling. Options include revealDurationMs, revealEasing and hoverTransition.
xAxisPropsNative XAxis presentation props—Ticks, tick formatting and spacing; numeric scale, domain, axis identity and bin midpoint are owned.
yAxisPropsNative YAxis presentation props—Tick presentation; numeric domain is [0, "dataMax"].
accessibilityLayerbooleantrue in RechartsArrow-key inspection; set explicitly in these components.
margin{ top?: number; right?: number; bottom?: number; left?: number }5 each sidePlot spacing.
childrenReactNode—Explicit histogram series, grid and tooltip.

Owns data, vertical layout, scales and spacing. See XAxis, YAxis and BarChart for presentation options.

HistogramSeries

PropTypeDefaultDescription
seriesKeystring"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 / strokestringConfig color / unsetExplicit paint overrides.
hidebooleanfalseHides 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.