Skip to content
Vega-Lite templates

Math — Chart: Histogram

A frequency histogram of binned measurements.

Template previewVega-Lite
Rendering…

Make it your own.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "Frequency distribution",
  "data": {"values": [
    {"bin": "0-9", "freq": 2},
    {"bin": "10-19", "freq": 6},
    {"bin": "20-29", "freq": 13},
    {"bin": "30-39", "freq": 19},
    {"bin": "40-49", "freq": 15},
    {"bin": "50-59", "freq": 8},
    {"bin": "60-69", "freq": 3}
  ]},
  "mark": "bar",
  "encoding": {
    "x": {"field": "bin", "type": "ordinal", "title": "Value (binned)"},
    "y": {"field": "freq", "type": "quantitative", "title": "Frequency"}
  }
}