The trick to displaying the adult-preference percentage is to treat the value as a series. But first, create the chart as you normally would (in Excel 2003):
- Select the data labels and data. In this case, you’d select A1:D5.
- Then, click the Chart Wizard on the Standard toolbar.
- Choose Bar as the Chart Type, click the Stacked Bar subtype, and click Next.
- For this chart, choose Rows as the series source and click Finish.
- Right-click the X axis (the flavors), choose Format Axis from the resulting context menu, and then click the Font tab. Choose 8 in the Size control and click OK.
- Right-click any of the values on the Y axis, choose Format Axis, and click the Font tab. Choose 8 in the Size control and click OK. (Depending on your settings, you might need to choose a smaller or larger font size.)
- Right-click the legend, choose Format legend, click the Font tab, and enter 8 as the Font size. Doing so should display the % Adults series, if you can’t see it in the legend.
The next step is to expose the % Adults series, as follows:
- Right-click the chart’s background and choose Chart Options.
- Click the Data Labels tab.
- Check Value in the Label Contains section and click OK. Doing so displays all values for all four series, but you want to display only the values for the % Adults series.
- You must hide the values for each series individually. Right-click the Children series and choose Format Data Series. (If you get a different context menu, try again. If you can’t get the right menu, move a data label from that series to expose the actual series and try again.)
- Click the Data Labels tab.
- Uncheck the Values option in the Label Contains section and click OK.
- Repeats steps 4 through 6 for the Teens and Adults series (but not the % Adults series).
- At this point, you’re nearly done, but the remaining data labels — the % Adults percentage — probably need to be repositioned. Right-click one of the remaining data labels and choose Format Data Labels.
- Click the Alignment tab.
- Choose Inside Base in the Label Position section.
- If you want, click the Font tab and reduce the size of the data label.
- Click OK.
The addition of the % Adults value tells an important story, at just a glance. Visually (see the complete chart above) you can see that the adults make up the larger portion of chocolate lovers, but you can quickly discern that 51% of chocolate lovers are adults, 26% of strawberry lovers are adults, and 14% of vanilla lovers are adults. The legend continues to display the % Adults series, which is a bit awkward, but not a truly horrible offense. If the color scheme is right, you can display the data labels in a matching color, making the relationship between the legend item and the values obvious. Or display the legend key in the series. Another solution is to just delete the legend. This technique is a combination of charting the right expression to support the chart’s purpose and exploiting a few chart properties to display that supportive information in a meaningful way.
Subscribe to the Developer Insider Newsletter
From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays