Labels and legends
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.
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.
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.
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).
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.
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.