PTS Blog

Custom Solutions | Commercial Utilities | Training | Charts and Tutorials | PTS Blog

 

Main menu:

 
Peltier Tech
Chart Utilities

PTS Waterfall Chart Utility
PTS Cluster-Stack Column Chart Utility
PTS Box and Whisker Chart Utility
PTS Marimekko Chart Utility
PTS Dot Plot Utility
PTS Cascade Chart Utility

Subscribe

Site search

Subscribe

Site search


Recent Posts

Recently Commented

Popular Posts

Archive


 

Categories


 

Buy me a coffee

If this topic or the whole blog has been helpful, support further development by treating me to a cup of coffee.


Privacy Policy

Creative Commons License
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

Label Totals on Stacked Column Charts

by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2009.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

A common question is “How can I label the total stack values in a stacked column chart?” When you add data labels to the chart, you can’t get any labels showing the totals.

Let’s use some simple data to illustrate.

stacked chart data

Here is a standard stacked column chart.

stacked column chart

When we apply data labels to the chart, we get a label for each column segment in the stack, but no labels for the total of each stack.

stacked column chart with labels

We only need to add a series to the chart that encodes the totals. Column E has the totals for each stack.

stacked chart expanded data

Construct the chart as a stacked column chart, with the Totals column stacked on top.

stacked column chart with totals series

Change the Totals column series to a line chart type series.

stacked column chart with totals line chart series

Add data labels to the Totals series.

stacked column chart with totals line chart series and labels

Move the labels to the Above position (right click on the labels and choose “Format” to open the format dialog).

stacked column chart with totals line chart series and labels

Hide the Totals series by formatting it to show no lines and no markers.

stacked column chart with totals labels

Nicely done, without being too sneaky: just one hidden series.

Possibly Related Posts:

Bookmark and share this entry:
  • Digg
  • del.icio.us
  • Facebook
  • Technorati
  • Twitter
  • StumbleUpon
  • Google Bookmarks
  • Reddit
  • MySpace
  • Slashdot
  • LinkedIn
  • Yahoo! Buzz

Learn how to create Excel dashboards.

Comments


Comment from Robert
Time: Thursday, October 29, 2009, 7:32 am

Helpful post thanks. Is it possible to achieve this on a horizontal stacked bar chart too?


Comment from Jon Peltier
Time: Thursday, October 29, 2009, 7:36 am

Robert -

I’ts possible to get this effect in a stacked bar chart, but it’s not as easy. You can’t use a line chart series for the labels. You could use an XY series, and you’d have to mess around with the primary and secondary axis scales (see Bar-Line Combination Chart). Or you could add another bar series onto the stack, with values of zero and custom labels. Good topic for a follow up.


Comment from Tony
Time: Thursday, October 29, 2009, 12:13 pm

I like that you have the x-axis as being a category versus time because we all know that a stacked column chart is bad for showing data series’ over time, right? Good tip!


Comment from chip
Time: Thursday, October 29, 2009, 12:35 pm

Jon, I do these slightly differently and it works for bar charts (per Robert’s request) the same as for column charts and has I think fewer steps.

Same methodology up through where the totals are added. Instead of converting to a line chart:

1. Open the formatting for that series, change it to Secondary Axis. Now it’s sitting in front of the stacked bars I really want to see.

2. Add data labels to that series. (They go in the right spot at the top of the bar).

3. Format the area pattern as None and the border as None.

The bar disappears, leaving the data labels and the underlying stacked bars or columns.

This is another one of the things that Harvard Graphics for DOS used to do automatically! Silly that you have to trick the program to add these.


Comment from Jon Peltier
Time: Thursday, October 29, 2009, 12:49 pm

Thanks, Chip. I was going to write this up as a follow-up, but you’ve done it for me. I suppose I could make a illustrated version….


Comment from Robert F
Time: Friday, October 30, 2009, 2:48 pm

You can also use the right menu to change the total part of the stack to area and border= none. Then select total data labels adn change the alignment label position = inside base.

Write a comment

I welcome comments from my readers. If you have an opinion on this post, if you have a question or if there is anything to add, I want to hear from you. Whether you agree or disagree, please join the discussion.

If you want to include an image in your comment, post it on your own site or on one of the many free image sharing sites, and include a link in your comment. I'll download your image and insert the necessary html to display the image inline.

Read the PTS Blog Comment Policy.





Subscribe without commenting

PTS Waterfall Chart Utility PTS Cluster-Stack Column Chart Utility PTS Box and Whisker Chart Utility PTS Marimekko Chart Utility PTS Dot Plot Utility PTS Cascade Chart Utility

Create Excel dashboards quickly with Plug-N-Play reports.