Wednesday, February 12, 2020

Creating 3D Bar Chart via Custom Shapes

I am shown a 3D bar chart (via custom shapes) by some people. It is created the talented Toan Hoang at Tableau Magic. Here I re-created the same chart using a little different approach, without extra file and joins.

1.Download the custom shapes (cube pictures) from the above web page and save them into My Document\Tableau Repository\Shapes\Cubes folder. (You can use my workbook below and steal them if you wish).

2.Import the data source and union it with itself as shown below.
3.Create Path 
  • IF [Table Name]={MIN([Table Name])} 
  • THEN 0
  • ELSE 100
  • END
100 here is a number equal or greater than the max of the bars. Change it to another number if necessary.

4.Create bins from Path with bin size =1: Path (bin)

5.Create Row and set it to compute along Path (bin) by default
  • IF LAST()-1 <= WINDOW_MAX(MAX([Value])) 
  • THEN   LAST()-1
  • END
6.Move Country to Columns and Path (bin), Row to Rows. Right click Path (bin) and check Show Missing Values

7.Move Path (bin) to Details.

8.Select Shapes as data marks. Open Shapes shelf, reload Shapes and select the cubes folder. Pick one of the cubes and apply.
Now you should see something similar to this.
Voila, we got a 3D-like bar chart. Have fun with Tableau! 

You can download the above workbook here.


No comments:

Post a Comment