Histogram chart

Show how one sample of raw values spreads in a histogram chart: equal-width bins, with the binning rule, the bin width and n printed on the chart.

React
import { HistogramChart } from 'boardplot/react/histogram';
Use for
Order value distribution · Spread of lead times · Deal size distribution
Not for
Binned counts or categorical values; histogram bins raw numeric observations.

Order-to-ship cycle time distribution

clustered column chart, 13 categories × 1 series. Totals: 1 2, 2 3, 3 12, 4 19, 5 26, 6 33, 7 29, 8 22, 9 15, 10 15, 11 3, 12 0, 13 1. Cycle time peaks in the six-to-eight-day band and tails off by day thirteen Order-to-ship cycle time in days · FY25 Source: Fulfilment log 2 1 33 29 26 22 19 15 15 12 3 3 1 2 11 12 13 3 4 5 6 7 8 9 10

Histogram of cycle time in one-day bins from 1 to 13 days; the peak is 33 orders in the 6 to 7 day bin and the tail ends at 1 order in the last bin.

Download SVG Fixture IDcycle-time-days
JSON spec

This spec includes the theme shown and the options you selected.

Changed from the fixture: options.size from the report frame to the width of the site frame.

{
  "type": "histogram",
  "data": {
    "observations": [
      5,
      7,
      10,
      6,
      6,
      8,
      6,
      4,
      3,
      9,
      7,
      10,
      2,
      6,
      9,
      5,
      10,
      6,
      10,
      6,
      8,
      6,
      8,
      10,
      7,
      3,
      6,
      4,
      3,
      10,
      6,
      13,
      7,
      6,
      8,
      6,
      5,
      9,
      7,
      7,
      5,
      6,
      6,
      6,
      4,
      3,
      5,
      8,
      6,
      7,
      1,
      8,
      7,
      9,
      8,
      6,
      8,
      5,
      8,
      4,
      11,
      9,
      7,
      3,
      8,
      4,
      7,
      9,
      3,
      6,
      6,
      6,
      5,
      9,
      5,
      7,
      4,
      7,
      6,
      10,
      8,
      5,
      7,
      11,
      9,
      3,
      4,
      8,
      4,
      6,
      4,
      4,
      5,
      4,
      1,
      2,
      6,
      3,
      8,
      7,
      3,
      4,
      7,
      5,
      5,
      7,
      7,
      6,
      6,
      9,
      10,
      10,
      4,
      5,
      9,
      8,
      7,
      8,
      10,
      8,
      7,
      4,
      9,
      8,
      10,
      8,
      5,
      4,
      6,
      6,
      8,
      10,
      5,
      5,
      7,
      6,
      6,
      9,
      6,
      9,
      10,
      6,
      8,
      4,
      5,
      7,
      5,
      3,
      7,
      9,
      8,
      7,
      6,
      5,
      6,
      7,
      4,
      7,
      5,
      5,
      9,
      6,
      7,
      5,
      3,
      5,
      7,
      3,
      5,
      7,
      10,
      2,
      10,
      5,
      4,
      7,
      5,
      4,
      11,
      8
    ]
  },
  "options": {
    "title": "Cycle time peaks in the six-to-eight-day band and tails off by day thirteen",
    "subtitle": {
      "measure": "Order-to-ship cycle time",
      "period": "FY25"
    },
    "unit": "days",
    "source": "Fulfilment log",
    "bins": {
      "width": 1
    },
    "axisTitles": {
      "y": "Orders"
    },
    "size": {
      "width": 1000
    }
  }
}

Right-skewed order values

clustered column chart, 10 categories × 1 series. Totals: 0–250 76, 250–500 52, 500–750 27, 750–1,000 24, 1,000–1,250 13, 1,250–1,500 14, 1,500–1,750 15, 1,750–2,000 4, 2,000–2,250 8, 2,250–2,500 7. Order value is heavily right-skewed: half of all orders fall in the two lowest bins Order value in $ · FY25 Source: Order book extract 76 7 52 27 24 15 14 13 8 4 0 250 2,500 500 750 1,000 1,250 1,500 1,750 2,000 2,250

Histogram of order value in $250 bins up to 2,500; 76 and 52 orders fall in the two lowest bins, about half of 240 orders.

Download SVG Fixture IDorder-value-distribution
JSON spec

This spec includes the theme shown and the options you selected.

Changed from the fixture: options.size from the report frame to the width of the site frame.

{
  "type": "histogram",
  "data": {
    "observations": [
      226,
      223,
      1247,
      200,
      2026,
      1515,
      200,
      1385,
      1840,
      763,
      247,
      1038,
      356,
      2293,
      200,
      663,
      200,
      578,
      200,
      200,
      1451,
      1265,
      617,
      200,
      2041,
      203,
      271,
      1286,
      200,
      1251,
      510,
      326,
      261,
      200,
      1684,
      218,
      667,
      752,
      236,
      443,
      512,
      464,
      216,
      211,
      220,
      559,
      672,
      202,
      2195,
      215,
      1027,
      296,
      262,
      268,
      203,
      397,
      233,
      204,
      411,
      432,
      202,
      897,
      476,
      2041,
      458,
      936,
      204,
      1691,
      257,
      356,
      1015,
      950,
      247,
      1517,
      2324,
      393,
      1227,
      202,
      796,
      201,
      295,
      201,
      1477,
      200,
      531,
      206,
      203,
      261,
      200,
      200,
      259,
      1401,
      223,
      615,
      214,
      769,
      401,
      202,
      258,
      2328,
      2307,
      399,
      902,
      440,
      1938,
      796,
      285,
      515,
      966,
      696,
      202,
      950,
      1508,
      876,
      202,
      2108,
      637,
      211,
      1458,
      1274,
      437,
      748,
      262,
      1667,
      770,
      538,
      896,
      204,
      1184,
      2352,
      200,
      200,
      252,
      200,
      1280,
      1121,
      226,
      357,
      200,
      243,
      265,
      829,
      720,
      210,
      270,
      237,
      361,
      460,
      1016,
      403,
      586,
      715,
      2188,
      348,
      306,
      1054,
      202,
      207,
      1020,
      200,
      838,
      556,
      1617,
      1691,
      563,
      230,
      1129,
      1577,
      1710,
      1865,
      870,
      484,
      533,
      257,
      711,
      200,
      200,
      200,
      795,
      880,
      213,
      200,
      201,
      331,
      336,
      2324,
      1852,
      331,
      200,
      461,
      1399,
      1693,
      308,
      212,
      216,
      1482,
      1229,
      638,
      549,
      1693,
      243,
      1669,
      1049,
      2133,
      1254,
      219,
      208,
      743,
      856,
      473,
      367,
      596,
      400,
      200,
      203,
      246,
      895,
      2148,
      482,
      1556,
      277,
      217,
      202,
      769,
      200,
      1397,
      989,
      461,
      201,
      234,
      324,
      443,
      858,
      546,
      2270,
      200,
      200,
      433,
      201,
      1585
    ]
  },
  "options": {
    "title": "Order value is heavily right-skewed: half of all orders fall in the two lowest bins",
    "subtitle": {
      "measure": "Order value",
      "period": "FY25"
    },
    "unit": "$",
    "source": "Order book extract",
    "bins": "auto",
    "axisTitles": {
      "y": "Orders"
    },
    "size": {
      "width": 1000
    }
  }
}

Minimal spec

Save this spec as histogram.json and run the command.

{
  "type": "histogram",
  "data": { "observations": [2, 3, 3, 4, 4, 5, 6, 7, 8, 9, 10, 12] },
  "options": {
    "unit": "days",
    "bins": { "width": 2.5, "anchor": 2 },
    "title": "Delivery times range from 2 to 12 days",
    "source": "Illustrative data"
  }
}
npx boardplot render histogram.json --out histogram.svg