Skip to content
Vega-Lite templates

Layered Marks (line + points + rule)

Composite chart with line + point overlay + reference line in one spec.

Template previewVega-Lite
Rendering…

Make it your own.

{
  "$schema":"https://vega.github.io/schema/vega-lite/v5.json",
  "data":{"values":[
    {"t":1,"v":4.2},{"t":2,"v":4.8},{"t":3,"v":5.3},{"t":4,"v":5.0},
    {"t":5,"v":5.9},{"t":6,"v":6.4},{"t":7,"v":7.1}
  ]},
  "layer":[
    {"mark":{"type":"line","color":"#1f47f5","strokeWidth":2}},
    {"mark":{"type":"point","color":"#1f47f5","size":80,"filled":true}},
    {"mark":{"type":"rule","color":"#dc2626","strokeDash":[4,4]},
      "encoding":{"y":{"datum":5,"type":"quantitative"}}}
  ],
  "encoding":{"x":{"field":"t","type":"quantitative","title":"Time"},
              "y":{"field":"v","type":"quantitative","title":"Value"}},
  "width":420,"height":260
}