Working with the legend
By default, a chart displays a legend. The legend uses a transparent background and does not include an outline or a shadow. To highlight the legend area, add a background color, outline, or shadow. You can hide the legend or change its position in the chart area, add a legend title, or modify legend text properties, such as the font size.
Setting the color, outline, or shadow for the legend
When applying a background color or outline to a chart legend, you can work with the entire legend area or with the text area only. Figure 21‑69 shows the difference between the two areas in a sample chart. If you apply a background color to the legend area, the color also appears in the text area, unless you set a background color in the text area that overrides the legend area settings. You can add a shadow only to the text area, not the entire legend area.
Figure 21‑69 Legend areas
To format the legend, navigate to the Chart Area section of Format Chart and select Legend. First, select Visible in both places in the Legend section, as shown in Figure 21‑70, to make the legend area and legend title visible. Then, choose either Title, Layout, or Entries.
Figure 21‑70 Options in the Legend section of a pie chart
To format the legend area, navigate to the Legend section of Format Chart, select Layout, then use Legend Layout, shown in Figure 21‑71.
Figure 21‑71 Background option in Legend Layout
To prevent truncation of the legend, increase the wrapping width. Specify a maximum width for legend items. Items that extend beyond the wrapping width appear on multiple lines in the legend.
Placing and adding space around a legend
Use anchor settings to modify where the legend appears within the chart. To determine how much padding appears between the legend or legend text areas and other chart features, use the inset settings.
To adjust the position of the entire legend area, rather than the client area where the legend items appear, change the legend position setting. Position a legend relative to the plot. For example, Figure 21‑72 shows different legend positions in a sample chart.
Figure 21‑72 Legend positions, above, below, and inside the plot
You can also organize legend items within the legend client area. For example, in Figure 21‑73, the chart on the left shows legend items arranged horizontally. The chart on the right shows legend items arranged vertically. To adjust the positions of legend items in the legend client area, set the legend orientation.
Figure 21‑73 Horizontal and vertical legend orientation
Showing series item values in a legend
Typically, a legend displays only series item names. The legend can also display the values of series items. To display values in the legend, navigate to the Legend area of Format Chart, then select Show Value, as shown in Figure 21‑74.
Figure 21‑74 Displaying values in the legend
A pie chart always shows the legend values, so the Legend section of a pie chart does not include Show Value.
Formatting the legend text
You can change the font style and size of the legend text. For multiple series, add a separator line between the items in one series and the items in the next.
To format the legend text, navigate to the Legend section of Format Chart. Choose Entries, then choose Font Editor, as shown in Figure 21‑75. Use the font editor to modify the font attributes.
Figure 21‑75 Legend title formatting options
Formatting a legend title
You can use a title for the chart legend. When you first add the title, the chart builder uses default font settings and the title appears above the list of legend items. You can change the font style and color of the title. You can also add a title outline, background color, or shadow, or position the title below, to the left, or to the right of the legend text.
To add and format the title of the legend, navigate to the Legend section of Format Chart. Figure 21‑70 shows the Legend section options. Select Visible to show the title, then type the title text. To format the title, choose Title. Then use the settings shown in Figure 21‑75 to format the title.