Line Chart Best Practices: 7 Rules That Fix Most Charts

⏱️ 3 min read 📊 Visualization

The core line chart best practices are simple: use lines only for continuous data (usually time), plot four lines or fewer, pick a y-axis range that shows the trend honestly (a zero baseline is not required for line charts), and label lines directly instead of relying on a legend. Everything else is a refinement of those four rules.

Quick answer: The seven line chart rules that matter: (1) lines are for continuous data only, (2) four lines maximum before switching to small multiples, (3) a zero baseline is optional for line charts — position and slope stay honest without it, (4) label lines directly instead of using a legend, (5) show gaps for missing data, (6) avoid dual y-axes unless units genuinely differ, and (7) annotate the events that explain the shape.

When Should You Use a Line Chart?

Use a line chart when your x-axis is continuous and ordered, almost always time, and the point is how values change: stock prices, website traffic, temperature, monthly revenue. The connecting line implies that intermediate values exist between points, so if that implication is false, a line chart is the wrong choice.

If you're unsure which chart fits your data, run through a chart selection framework first.

How Many Lines Should a Line Chart Have?

Three to four lines is the practical maximum; beyond five, the chart turns into spaghetti and readers stop tracing individual series. If you must show many series, highlight the one or two that matter in full color and render the rest in light gray, or split the chart entirely.

1-3 lines: ideal, easy to follow
4-5 lines: workable if colors are distinct
6+ lines:  spaghetti - restructure the chart

Fixes for many series:
- Small multiples (one mini chart per series)
- Highlight 1-2 lines, gray out the rest
- Interactive filtering or toggling

Whatever the count, make lines distinguishable: distinct colorblind-safe colors for 2-4 lines, varied dash patterns if the chart may be printed in black and white, and a thicker stroke for the primary series.

Should You Label Lines Directly or Use a Legend?

Label lines directly at their right endpoint whenever the layout allows it. A legend forces the reader's eye to bounce between the plot and a color key, and with similar hues that lookup fails entirely; a label sitting at the end of its line is read in a single glance. Reserve legends for cases where direct labels physically can't fit — many series ending at nearly the same value, or very narrow charts.

Legend (slower):            Direct labels (faster):

  ~~~~~~~~                     ~~~~~~~~ Product A
  --------                     -------- Product B
  ........                     ........ Product C
  ■ A  ■ B  ■ C

If two lines end too close together, nudge one label vertically or label at the line's peak instead. Matplotlib's ax.annotate, Plotly's mode="lines+text", and D3 all make endpoint labels a few lines of code.

Should You Ever Use a Dual-Axis Line Chart?

Almost never. Two independent y-axes let you make any two series appear correlated (or not) just by rescaling one axis, which is why dual-axis charts are the classic tool of misleading visualization. If the two series share units, plot them on one axis; if they don't, use two stacked panels with a shared x-axis, or index both series to 100 at the start.

The narrow legitimate case: two genuinely different units (revenue and temperature), both axes clearly labeled and color-matched to their lines, and an audience that expects the format. The full set of traps and the panel-based alternatives are in the dual-axis charts guide.

Does a Line Chart Need to Start at Zero?

No. The zero-baseline rule applies to bar charts, not line charts. Bars encode value by length, so truncating the axis literally lies about magnitude, but lines encode value by vertical position and trend by slope, neither of which requires zero to be honest. Forcing a zero baseline on data that lives far from zero (blood pressure in the 90-120 range, pH from 6.5 to 7.5, stock prices) flattens real variation into a useless straight line.

That said, axis range is still a rhetorical choice. Follow these rules:

How Should You Handle Missing Data in a Line Chart?

Leave a visible gap in the line rather than silently connecting across the hole, because an unbroken line claims you know values you don't have. Most libraries do this by default when a value is null; interpolation should be an explicit, labeled choice, not an accident.

Missing data options, best to worst:
1. Break the line (gap) and note why data is missing
2. Dashed segment across the gap = "interpolated"
3. Impute values, clearly footnoted

Never: connect straight across a 3-month hole
       as if nothing happened

Related trap: uneven time intervals. Plotting Jan, Feb, Mar, Aug, Dec at equal spacing distorts every slope in the chart. Keep intervals consistent, and if you must skip periods, mark the break on the axis.

How Do You Annotate a Line Chart?

Annotate the two or three moments that explain the shape of the line: a product launch, a pricing change, a holiday spike. Raw trends rarely speak for themselves, and a short label at the right point saves a paragraph of caption text.

Keep annotations subtle in weight so they support the data instead of competing with it. See chart annotation best practices for layout details.

What Are Small Multiples and When Should You Use Them?

Small multiples replace one crowded chart with a grid of mini line charts, one per series, all sharing the same axes and scale. They are the standard fix for the 6+ line problem: each trend stays readable, and shared scales keep the panels comparable at a glance.

Use them when series overlap heavily, when you have 5-20 series, or when the story is "which of these behave differently?" rather than "which is highest right now?" The one non-negotiable rule: identical y-axis ranges across panels, or comparisons become meaningless. Full walkthrough in the small multiples guide.

What Are the Most Common Line Chart Mistakes?

The most common mistakes are connecting discrete categories with a line, cramming in too many points or series, cropping the y-axis to exaggerate change, and mixing time granularities on one axis. Each one either lies about the data or buries the trend.

Quick Checklist Before Publishing

Run through this list before a line chart goes into a report or dashboard; each item takes seconds to verify and catches the mistakes readers notice most.

Golden Rule: The slope of a line is more important than its absolute position. Design your chart so trends are obvious at a glance. If someone has to squint or study your chart for 30 seconds, your Y-axis range or aspect ratio is wrong.

← Back to Visualization Tips