Labels and legends

How to label a chart so people can tell what it shows, from series and categories to data values.

Labels and legends help people understand what the data in a chart represents. This section covers labels for series, categories and values. This page covers series.

Label series directly where you can

Place each label next to the data it describes, so people don’t have to look back and forth between the chart and a legend.

Use direct labels when there is room for them and each label clearly belongs to one series.

A chart with more than one series needs a way to tell them apart, either direct labels or a legend. A chart with a single series needs neither when its title makes clear what it shows.

Do
Place each name beside its slice.
Don't
Don’t use a legend when each slice can be labelled directly.

Use a legend when direct labels aren’t enough

Use a legend when direct labels would overlap, crowd the chart or be unclear about which series they belong to. Also use one when it lets people show or hide series (see Interaction).

Don’t show both a legend and direct labels for the same series, because they repeat each other, unless the legend is interactive. If some series can’t be labelled directly, use a legend for all of them, so people don’t have to work out which series to read which way.

Do
Use a compact legend when direct labels would overlap.
Don't
Don’t squeeze in direct labels that overlap.

Match the legend to the chart

Show each series in the legend with the same colour, marker shape or pattern it has in the chart.

Do
Use the same colours and styling in the legend as in the chart.
Don't
Don’t style legend entries differently from their series.

Consider a second cue besides colour

A legend asks people to match series by colour, which some people find difficult. For filled series, consider letting people turn patterns on (see Fills and patterns). For lines, consider markers with a different shape for each series (see Lines and markers).

Do
Show the same marker shape in the legend as on the line.
Do
Show the same pattern in the legend as on the bars, when patterns are on.

Place the legend close to the chart

Place the legend close to the chart so people can link it to the data at a glance.

  • Below: the default. Works well for a small number of short or medium-length labels.
  • Above: use when people need to see the legend before they read the data, or when it improves visual hierarchy and readability.
  • Right: use when there are many or long labels that would wrap onto several lines in a horizontal legend.
  • Left: avoid on charts with a y-axis, because the legend competes with the axis labels.
Do
Place the legend where it doesn’t compete with the data or axes.
Don't
Don’t place the legend where it competes with the axis labels.

List series in chart order

List series in the legend in the same order as in the chart: left to right for grouped bars, clockwise for a donut, and from the first segment (the bottom or left) to the last for stacked bars. For more about series order, see Data series.

Do
List series in the legend in the same order as in the chart.
Don't
Don’t list series in a different order from the chart.

See also