Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There are a lot of questions here about formatting of barcharts, but I couldn't find one matching mine. I seek to display data in stacked format, labeling each component of the stack and the total for each bar. I can't make it work for the life of me.

As a starting place, consider

BarChart[{{1, 2}, {2, 3}, {2, 4}}, ChartLayout -> "Stacked", 
 ChartLabels -> {Range[2004, 2006], None}]

I want each component labeled as below --


My efforts to date result in some pieces appearing but never all, and often in the wrong places.

share|improve this question
up vote 7 down vote accepted
BarChart[Labeled[#, Total[#], Above] & /@ {{1, 2}, {2, 3}, {2, 4}}, 
         ChartLayout -> "Stacked", ChartLabels -> {Range[2004, 2006], None}, 
         LabelingFunction -> (Placed[#1, Center] &)]

enter image description here

share|improve this answer
+1 was about to post but you got there while I was still eating my breakfast :) – Mike Honeychurch Jun 12 '14 at 22:52
@MikeHoneychurch: LOL, I'm usually last to the party re:plotting/graphics against you and other plot wizards - it just happens I needed this very layout not long ago... thanks for + ! – ciao Jun 12 '14 at 23:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.