This website is for Vega-Lite v3. Go to the main Vega-Lite homepage for the latest release.

Horizontally repeated charts

Horizontally repeated charts that show the histograms of different parameters of cars in different countries

View this example in the online editor

Vega-Lite JSON Specification

{
  "$schema": "https://vega.github.io/schema/vega-lite/v3.json",
  "repeat": ["Horsepower", "Miles_per_Gallon", "Acceleration", "Displacement"],
  "columns": 2,
  "spec": {
    "data": {"url": "data/cars.json"},
    "mark": "bar",
    "encoding": {
      "x": {
        "field": {"repeat": "repeat"},
        "bin": true,
        "type": "quantitative"
      },
      "y": {"aggregate": "count", "type": "quantitative"},
      "color": {"field": "Origin", "type": "nominal"}
    }
  }
}