Line chart

Line charts are for time. The connecting line implies continuity, which is exactly why they are wrong for categories: connecting Billing to Access implies something that is not true.

Multiple series are fine, up to about five. Beyond that use small multiples.


#When this is the right chart

  • Trends over time.

  • Comparing a few series on the same scale.

  • Before and after, where the shape of the change matters.


#What the data needs to look like

Field

Type

Time

Temporal: a date or timestamp

Value

Quantitative

Series

Nominal, optional: one line each


#A worked example

Two series over eight weeks:

Line chart

The source, which you can paste into a new diagram and edit:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "Weekly active users by plan",
  "width": 380,
  "height": 220,
  "data": {"values": [
    {"week": "2026-07-06", "plan": "Free", "users": 1210},
    {"week": "2026-07-13", "plan": "Free", "users": 1305},
    {"week": "2026-07-20", "plan": "Free", "users": 1288},
    {"week": "2026-07-27", "plan": "Free", "users": 1402},
    {"week": "2026-07-06", "plan": "Team", "users": 420},
    {"week": "2026-07-13", "plan": "Team", "users": 468},
    {"week": "2026-07-20", "plan": "Team", "users": 515},
    {"week": "2026-07-27", "plan": "Team", "users": 559}
  ]},
  "mark": {"type": "line", "point": true},
  "encoding": {
    "x": {"field": "week", "type": "temporal", "title": "Week"},
    "y": {"field": "users", "type": "quantitative", "title": "Active users"},
    "color": {"field": "plan", "type": "nominal", "title": "Plan"}
  }
}

#A few things that catch people out

  • Set the field type to temporal, or dates are treated as unordered categories.

  • Do not connect categories with a line. That is a bar chart wearing a disguise.

  • Label the series directly if you can; legends cost the reader a lookup.



Pick the chart for the question, not for the look.