Skip to content
Vega-Lite templates

Multi-series Line

Time series with multiple series.

Template previewVega-Lite
Rendering…

Make it your own.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "values": [
      {"t":1,"v":2.1,"s":"A"},{"t":2,"v":2.6,"s":"A"},{"t":3,"v":3.0,"s":"A"},{"t":4,"v":3.4,"s":"A"},{"t":5,"v":3.7,"s":"A"},
      {"t":1,"v":1.4,"s":"B"},{"t":2,"v":1.7,"s":"B"},{"t":3,"v":2.2,"s":"B"},{"t":4,"v":2.9,"s":"B"},{"t":5,"v":3.6,"s":"B"},
      {"t":1,"v":3.2,"s":"C"},{"t":2,"v":3.0,"s":"C"},{"t":3,"v":2.6,"s":"C"},{"t":4,"v":2.2,"s":"C"},{"t":5,"v":1.9,"s":"C"}
    ]
  },
  "mark": {"type":"line","point":true},
  "encoding": {
    "x":{"field":"t","type":"quantitative","title":"time"},
    "y":{"field":"v","type":"quantitative","title":"value"},
    "color":{"field":"s","type":"nominal","title":"series"}
  },
  "width": 420, "height": 260
}