Skip to content
Vega-Lite templates

Faceted Small Multiples

Small-multiple faceting: one panel per category, shared axes.

Template previewVega-Lite
Rendering…

Make it your own.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {"values": [
    {"x":1,"y":2,"g":"A"},{"x":2,"y":3,"g":"A"},{"x":3,"y":1,"g":"A"},
    {"x":1,"y":1,"g":"B"},{"x":2,"y":2,"g":"B"},{"x":3,"y":4,"g":"B"},
    {"x":1,"y":4,"g":"C"},{"x":2,"y":2,"g":"C"},{"x":3,"y":3,"g":"C"}
  ]},
  "mark": "line",
  "encoding": {
    "x": {"field":"x","type":"quantitative"},
    "y": {"field":"y","type":"quantitative"},
    "facet": {"field":"g","type":"nominal","columns":3}
  },
  "width": 140, "height": 100
}