Sub topic 9
Positioning and styling the legend
This chapter assumes you can insert a chart, open the chart editor, and tell the Setup tab from the Customize tab. It also assumes you know what a series is: one set of values drawn as a line, a group of columns, or a slice of a pie. If any of that is unfamiliar, review the earlier chapters on inserting a chart and the chart editor first.
What the legend does
A legend is the key that links each visual encoding in a chart, usually a colour, to the series or category it represents. Without it, a chart with three lines is a puzzle. With it, the reader matches colour to meaning at a glance.
The legend takes its text from the header cells of your data range. If a header reads "Q1 Sales", the legend entry reads "Q1 Sales". Fixing a confusing legend label therefore usually means editing the header cell, not the chart.
A legend is not always needed. A single-series chart that already has a clear title, such as "Monthly revenue 2026", gains nothing from a legend that repeats the title. Sheets often hides the legend automatically for single-series charts, and you can turn it off yourself.
Where to find the legend settings
- Click the chart once to select it.
- Open the chart editor by clicking the three-dot menu at the top right of the chart and choosing Edit chart. Double-clicking the chart also works.
- Switch to the Customize tab.
- Expand the Legend section.
The section offers a small set of controls, which the next table summarises.
| Control | What it does | Typical use |
|---|---|---|
| Position | Places the legend at the top, bottom, left, right, or inside the chart, or hides it with **None** | Match the legend to the chart's shape and available space |
| Font | Sets the typeface | Match the rest of the sheet or document |
| Font size | Sets the text size | Make labels readable when the chart is shrunk or projected |
| Font format | Applies bold or italic | Add emphasis, used sparingly |
| Text colour | Sets the colour of the legend text | Improve contrast against the chart background |
The exact wording of the options can differ slightly between versions of Sheets, but the five controls above are the ones you will use.
Choosing a position
The position setting changes how much room the plot area gets. Sheets resizes the plot to make space for the legend, so a legend on the right shrinks the chart horizontally, and a legend on the top or bottom shrinks it vertically.
| Position | Works well when | Watch out for |
|---|---|---|
| Right | The chart is wide and you have few series with short names | Long labels wrap or truncate and squeeze the plot |
| Bottom | The chart is narrow, or you will paste it into a document | Many series push the legend onto several rows |
| Top | The legend should be read before the data | It competes with the chart title for attention |
| Left | The value axis is hidden or the layout is unusual | The legend may crowd the vertical axis labels |
| Inside | Space is tight and the plot has empty corners | It can cover data points |
| None | There is one series, or you label data directly | Readers lose the colour key if you have several series |
A sound default is bottom for charts that will appear in a slide or a document, and right for wide dashboard charts. Test your choice by resizing the chart to the size it will really be shown at, not the size you see while editing.
Tip on legend order
The order of entries follows the order of series in the chart editor. To change the legend order, reorder the series in the data, because the editor does not provide a drag handle for the legend itself. For stacked columns, this order matters because the visual stack and the legend should read in the same direction. Check them against each other after any change.
Styling for readability
Styling choices affect whether the legend helps or distracts. The following guidelines cover most cases.
- Size. Aim for a legend font that is close to the size of the axis labels. A legend that is much larger than the axis text pulls attention away from the data.
- Contrast. Use dark text on a light background or the reverse. Light grey text on white looks tidy on screen and disappears when projected.
- Weight. Leave legend text in regular weight. Bold is better saved for the chart title.
- Font. Use the same family as the title and axis labels. Mixed fonts look accidental.
Legend text colour does not change the colour swatches. The swatches take their colours from the series formatting, so to change the colour of a legend marker you change the series colour on the Customize tab under Series. The legend then updates by itself.
Making the legend say the right thing
Because legend labels come from your header cells, there are three common ways to correct them.
- Edit the header cell. Change "salesq1final" to "Q1 sales" in the source data. This fixes the chart and any other use of that header.
- Use a helper range. If the source headers must stay as they are, build a small separate range with presentable headers and chart that range. The earlier chapter on data layout covers this approach.
- Rename through a formula. If headers are produced by a formula, change the formula. Typing over a formula result in the chart is not possible, because the chart reads the cell.
The next example shows a QUERY that returns a summary table with a clean header for the legend. The label clause sets the header text, and that text becomes the legend entry.
=QUERY(A1:C100, "select A, sum(C) where B = 'North' group by A label sum(C) 'North sales'", 1)Without the label clause, QUERY would name the column sum Sales, which is a poor legend entry. With it, the legend reads "North sales".
Legends in specific chart types
Legend behaviour differs a little by chart type, and these differences cause some of the most common confusion.
- Line, column, bar, and area charts. One legend entry per series. If you chart three columns of data, you get three entries.
- Stacked charts. The legend still lists series, not totals. If you need to show a total, add it as a label or a separate series.
- Pie charts. Each slice is a category, so the legend lists categories rather than series. With many slices the legend becomes long. Consider direct labels on the slices, or group small categories into "Other".
- Combo charts. The legend lists every series regardless of whether it is drawn as a line or columns, and it does not say which axis a series uses. If you use a secondary axis, put that information in the series name, for example "Revenue (left axis)" and "Margin % (right axis)". The chapter on combo charts covers the axis setup.
- Scatter charts. With a single series there is usually nothing to key, so the legend is often unnecessary.
When to drop the legend
A legend forces the reader to look away from the data, find a colour, and look back. For charts with two or three series, direct labelling is faster to read. You can approximate it in Sheets by turning on data labels for the last point of each line, or by describing the series in the chart title, for instance "Online sales (blue) vs store sales (orange)".
Use these criteria to decide.
- Is there only one series? Remove the legend and let the title carry the meaning.
- Are there two or three series with distinct colours? A legend works, and direct labels may work better.
- Are there more than about six series? The legend becomes a lookup table and the colours become hard to tell apart. Consider splitting the chart or filtering the data.
Accessibility notes
About one in twelve men and one in two hundred women have some form of colour vision deficiency, so a legend that depends on colour alone can fail. Help your readers in these ways.
- Choose series colours that differ in lightness as well as hue.
- Vary line style or add point shapes where the chart type allows it, so series differ in more than colour.
- Keep legend text large enough to read without zooming.
- Put key information in the title or a nearby caption, not only in the legend.
Common problems
| Symptom | Likely cause | Fix |
|---|---|---|
| Legend shows "Series 1", "Series 2" | The header row was not detected | In **Setup**, tick **Use row 1 as headers** (or the equivalent column option) |
| Legend is missing | Position is set to None, or the chart has one series | Set a position under **Legend** |
| Legend text is cut off | The label is long and the chart is small | Shorten the header, enlarge the chart, or move the legend to the bottom |
| Legend lists the wrong items after a layout change | **Switch rows / columns** is on or off unexpectedly | Toggle it in Setup and check the result |
| Legend marker colour does not match the data | The series colour was edited, or a theme changed | Reset the colour under **Series** |
Worked example
Suppose range A1:D7 holds monthly sales for three regions, with headers Month, North, South, West, and you have inserted a line chart.
- Select the chart and open Edit chart, then Customize.
- Under Legend, set Position to Bottom.
- Set Font size to match your axis labels, for example 12.
- Set the text colour to a dark grey that contrasts with the white background.
- Under Series, give each region a distinct colour and a different line dash if available.
- Resize the chart to its final size and confirm that all three entries fit on one row.
If you later add a fourth region in column E, extend the range in Setup. The legend gains a fourth entry automatically.
Exercise
A line chart shows two series, but the legend reads "Series 1" and "Series 2" instead of "Online" and "In store". Your data has the headers in row 1. Name the first setting you should check and one other way to get better legend text.
Show answer
Check that the header option in the Setup tab of the chart editor is turned on, so row 1 is treated as headers rather than data. The legend then reads the header cells. Another way is to edit the header cells in the source data, or to chart a helper range that has clean headers.
Exercise
You build a combo chart with revenue as columns on the left axis and margin percentage as a line on a secondary axis. Readers keep misreading which scale belongs to which series. Does the Legend section let you fix this? What would you change instead?
Show answer
No. The Legend section controls only position and text style, and the legend does not show which axis a series uses. Put the axis in the series names, for example "Revenue (left axis)" and "Margin % (right axis)", by editing the header cells. You can also colour the axis titles to match each series.