VizWiz

Launch, grow, and unlock your career in data

May 19, 2015

Tableau Tip Tuesday: How to Label the Top of Stacked Bars

10 comments
This week's tip covers two methods for displaying the total of a stacked bar chart. Enjoy!


10 comments :

  1. Replies
    1. Sometimes simplest is best.

      Delete
    2. Hi Andy,

      We need to plot a stack bar with three diff sales value and also two targets as a scatter.
      Could you please advise if that is possible ?

      Regards
      Siddharth

      Delete
    3. Siddharth, first, I would recommend you try on your own. This is the best way to learn. Second, yes this is possible, though I'm not sure why you would want a stacked bar and a scatter on the same plot. In my head, I'm picturing sales as a stacked bar on the left axis and budget synchronized on the dual-axis set to a gantt bar. On the gantt bar, you'd have to change the calc to a running total so that they align with the stacks properly.

      Delete
  2. Hi Andy, very helpful tips. I have a dual axis stacked bar + line chart. I want to show both the grand total and individual values for the stacked bars. My stacked bars are showing 'Number of Records', split by colour for a specific state. Any advice on how best to accomplish this? I've tried both relative line and Gantt methods but neither work, think the dual axis might be the culprit.

    Many thanks!
    Gudmundur

    ReplyDelete
    Replies
    1. Double check what is on the Marks card for your secondary axis. Tableau will divide up the bars or lines if you have anything on the marks card.

      Delete
  3. How would one put a different cell-based value (e.g. MAX(OrderDate)) as the label?

    I am stacking bars in which the colors represent bins of completion time. Typically, I get a large number of green (good) with a possible red (oh no!) which is very small. I would like the top label to have something like MAX(CompletionTime) (bonus points if it could be color-coded) to show which mostly-good bars actually have one or more problematic members. Thoughts?

    ReplyDelete
    Replies
    1. Tom, if you use the secondary axis/Gantt technique then you can put whatever you want on the label shelf for that axis.

      Delete
  4. If I have my stacked bar charts as percent of total, calculated table down, how do I put the total number of cases (instead of 100%) at the top if each bar? With the Gantt method, it leaves my totals very low on the chart, instead of at the top. I wasn't able to get anything other than 100% using the reference line method. Thanks
    - Amy

    ReplyDelete
    Replies
    1. Hi Amy. To get the number above the bar instead of the percentage, put the field that represents your number of cases on the label shelf.

      Delete