Tuesday, March 5, 2013

[TABLEAU] Adding Totals To Stacked Bars


            Adding Totals to Stacked Bars

Adding totals to the tops of bars in a chart is sometimes as simple as turning on Data Labels from the Format menu. However, when the bars are broken down by color or size, each segment is labeled, rather than the total for the bar. With a few steps, you can add the total to the top of every bar for either horizontal or vertical bar charts such as the one below:



Add a reference line
You can use a reference line to automatically calculate the totals.

Step 1
Right-click the continuous axis and select Add Reference Line.

Step 2
In the Add Reference Line dialog box, select Line as the reference line type.

Step 3
Under Scope, select Per Cell.

Step 4
In the Line area, in the Value list, select Sum.

Step 5
In the Label list, select Value.

Step 6
Under Formatting, in the Line list, select None




Step 7
When finished, click OK.





Align the totals
The total is now displayed for each bar, but the numbers are left aligned.

Step 1
Right-click any of the totals on the bar chart and select Format.


Step 2
In the Format Reference Line pane, under Reference Line Label, click the list arrow for Alignment.


Step 3
Under Horizontal, click the middle icon to center the total over the bar.






The totals are now centered.














No comments:

Post a Comment