Skip to content
Vega-Lite templates

Histogram

Binned frequency distribution.

Template previewVega-Lite
Rendering…

Make it your own.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "values": [
      {"v": 1.1},{"v":1.5},{"v":1.8},{"v":2.1},{"v":2.2},{"v":2.4},{"v":2.5},{"v":2.6},{"v":2.7},{"v":2.8},
      {"v":3.0},{"v":3.1},{"v":3.1},{"v":3.2},{"v":3.4},{"v":3.5},{"v":3.6},{"v":3.8},{"v":3.9},{"v":4.0},
      {"v":4.1},{"v":4.3},{"v":4.5},{"v":4.6},{"v":4.7},{"v":4.9},{"v":5.0},{"v":5.2},{"v":5.4},{"v":5.6}
    ]
  },
  "mark": "bar",
  "encoding": {
    "x": {"field":"v","bin":{"maxbins":12},"type":"quantitative","title":"value"},
    "y": {"aggregate":"count","type":"quantitative","title":"count"}
  },
  "width": 380, "height": 240
}