Advance with Assist shares quick solutions to common challenges encountered by the InterWorks Assist on-demand team.
Question: I would like my users to see the product names above the bars in my bar chart instead of having them on the left of the bar to make it more presentable. How do I achieve this?
By having the field name sitting above each bar, the presentation of your bar chart can be enhanced for your users.
For this example, I’ll use the Sample-CoffeeChain data to show a bar chart for Sales per Product by having the Product Name above each bar:
Step 1: Build a Simple Bar Chart for Sales per Product
Drag Sales to Columns and Product Name to Rows to create a simple bar chart. Sort the bars in descending order of sum of Sales and, lastly, add a color gradient (Orange-Blue Diverging) to the bars by dragging Sales to Color on the Marks card:
Step 2: Build a Dual-Axis Chart
Click on the empty space on the right side of SUM(Sales) in Columns and type in AVG(0):
When you click ENTER, you will see another bar chart appear on the side:
Right-click on AVG(0) header in the view and select Dual Axis:
Once you do this, Tableau might change your view drastically but not to worry! We can fix that later. Let’s go ahead and synchronize these two charts. Right-click on the AVG(0) header again, and select Synchronize Axis:
Step 3: Final Build
On your SUM(Sales) Marks card, change the chart type to Bar. Similarly, on your AGG(AVG(0)) Marks card, change the chart type to Gantt Bar.
Bring Measure Names from the Data pane onto Rows, and bring Product Name onto Labels in your AGG(AVG(0)) Marks card:
In some cases, Tableau will decide to put the labels underneath the bars, in which case you just need to sort Measure Names. Right-click on Measure Names and go to Sort > Sort by Manual. Drag AVG(0) above Sales:
Step 4: Formatting
Uncheck Show Header for Product Name, Measure Names and AVG(0) axis:
On the AGG(AVG(0)) Marks card, reduce size to 0 (zero). Also, reduce color opacity to 0%. Remove row divider and grid lines:
Tip: Use Label on the AGG(AVG(0)) Marks card to change characteristics on the Label Text like font, size, alignment, etc.
I hope you found this Assist post helpful! You can download the workbook to explore things a bit more, and feel free to reach out to our team for more troubleshooting help or general support for your data.