Visualization

# Going 3D with Tableau

Even though they are not the type of visuals that first come to mind when you talk about business intelligence, if your background is in science or engineering like myself at some point in your career you probably did 3D charts. And by that I don’t mean 3D bar or pie charts. I mean scatter plots, contours, mesh surfaces… where 3rd dimension adds meaningful information.

If you wanted to do these types of charts in Tableau, how would you do them?

I thought it would be good to put together a few examples starting from the simplest and moving to more advanced visualizations. Let’s start with the scatter plot below.

Achieving this takes a background image (the cube image to emphasize the feeling of depth) and 3 simple calculated fields that re-project x,y,z coordinates to x_rotated and y_rotated fields. Wikipedia has a great summary if you’re curious where these formulas come from. You can use z_rotated field to set the size of the marks to give perspective effect to also to set the sort order of the marks so you get the z-order right. You can find this chart as a Tableau Public visualization HERE if you’d like to take a closer look or use it as an example for your own 3D scatter plots.

The example above shows rotating in 2 directions (dashboard exposes one control but you can download and open the sheet to see both options) but what if you wanted to be able to rotate in 3 different directions? I saved this for my next example as incremental change makes it easier to follow.

Caffeine molecule example above uses a dual axis chart. One axis draws the atoms while the other draws the bonds between them.  It still relies purely on the background image, mark size and z-order to achieve the 3D look just like the previous example but  you will notice that, this time “size” has a multiplier to account for the size of the atom in addition to the distance in 3D space to represent the relative sizes of different atoms. Another thing you’ll notice is that now that you’re using dual axis, z-order doesn’t always work well since Tableau sorts within each axis independently so in this setup atoms are always drawn above bonds but each group is sorted within themselves. You can find the Tableau public viz HERE or by clicking on any of the screenshots.

You can extend this basic idea to do many other types of 3D views. For example a contour plot like the one below and go from 2D contours on the left to perspective view with 3 extremely simple calculated fields.

Or 3D meshes that let you play with different parameters and allow you to explore results of different equations.

To look at waves and ripples…

Or draw filled surfaces…

Or doing just some viz art like downloading radio telescope data to build the album cover of Joy Division’s Unknown Pleasures album in 3D in Tableau.

How about also drawing axis, grids and even labels and have them rotate with the visualization instead of using a static background image and just have the marks rotate?

Since you’re custom drawing these objects, you will need to have data points for axis extents, grid cell coordinates etc. I did this using Custom SQL. You can find data used in all example workbooks HERE as well as the SQL used. But easiest way to understand how it works is exploring the visualization. Thanks to VizQL, you can simply drag the [Type] pill from color shelf to row shelf see the visualization broken into its pieces which will help you understand how lines (surfaces, grids etc.) are handled differently from points and how it is possible to turn on/off grid using a parameter.

Besides Custom SQL, there is very little change to go from static background image to dynamic axis. You will see there is a minor change only in the x_rotated field’s definition.

No 3D visualization post would be complete without an example that involves 3D glasses 🙂

To be honest  this post didn’t originally have one but as I was wrapping up the examples, I showed them to some co-workers. Apparently two Tableau developers (Steven Case and Jeff Booth) had put together a stereoscopic sphere example and they thought it would be a nice addition to this post and they were kind enough to share it with me.  Time to put on some anaglyph glasses…

In this post I tried to share some examples of how to create various types of useful 3D charts in Tableau. I hope you find it useful.

Standard

## 28 thoughts on “Going 3D with Tableau”

1. Hi Bora,

Thank you for another great article that forms the foundation of future work for me in Tableau. Articles like this are one of the reasons you are among the top Tableau bloggers.

I have been thinking about applications like these for a while. Some of my thoughts and applications can be found in these articles or links:

https://3danim8.wordpress.com/2015/07/30/using-tableau-ver-9-1-to-display-3d-data/

https://3danim8.wordpress.com/2014/09/26/reflections-of-the-past-and-a-vision-of-a-tableau-future/

https://3danim8.wordpress.com/2014/09/23/going-outside-the-lines-in-tableau-finite-element-analysis/

Ken

2. Kulbir says:

Great blog!!!really helpful….has helped me get out of some tricky situations….I has a question though…have you ever used .las files in tableau?I’m converting las files in csv and then using them them in tableau…but the number of these files is huge…is there a direct way to display .las files in tableau?

• unfortunately no. The best workaround I can think of is using something like las2dem to get the digital elevation model as an image file then use it as a background image. Not sure if it would work for your scenarios.

3. This is an amazing creative work with rotating 3d charts. Thank you for the inspiration Bora!

4. MakG says:

Bora,
Thank you for sharing. This is really helpful.
Would it be possible to point to the specific formulas that you used from the Wikipedia article for converting the x, y, z corrdinates into the two-dimensional x-rotated and y-rotated fields?
My matrix algebra dates back several years ago.
Thanks

5. MjG says:

Great work Bora. Could you please point to the specific formulas you used to transform the x,y,z coordinates into 2 dimensional x, y values? My matrix algebra is very rusty.
Thanks,
MjG

6. How can I put created viz to always in active status by using page shelf, as you putted on your blog?
First I though you have converted Viz to GIF but when I clicked on it, it is Published workbook.
Could you please share the html code by which you put it own you blog.

• It is a GIF. I just put a hyperlink on the gif to open the viz.

7. Is it possible for you to share the same in Tableau 9.0 please?

8. Mounika says:

hi, can you share the .twbx file.

• You can click on the link in the blog post for Tableau Public. There is a Download button at the bottom which should give you the option to download the twbx.

• Rick says:

hi Bora,
I could download twbx, but it has custom SQL to your database.. can you make a workbook available with sample extract so we can learn from it?

• You can use the “view data” option in the data pane (left hand side), to get a grid view of the data which then you can copy-paste into an Excel spreadsheet if you’d like to understand the structure or you can create an extract from that.

• You can ignore what orange button says. You should be able to select the Tableau Workbook option on the right hand side.

• Mounika says:

Thank you so much

9. johnny says:

hi Bora. really inspiring work. I am trying to download the twbx but the dwonload is not enable from tableua public. is there any way to get thid workbook? best regards

10. Downloading the workbook works like a charm and I see the data as well. which I can copy into Excel as you suggested here. What I am not so sure about yet is how I can adjust it. Let’s take a simple example: what if I wanted to show 3 data points, all of different size and color in a 3D space. Let’s say all axes have 4 values: 1, 2, 3 and 4. One datapoint is at 1, 1, 1 and I want small and blue; second is 1, 2 , 3 and I want twice as big and blue and third is 3, 2, 2 and is three times the size of the first and red. How would I go about doing that? Thanks much!

11. TA says:

Hi Bora,

I read your article on these 3D visuals you made and I am fascinated in how you’ve created them. I have been trying to recreate your methodology for your 3D Scatterplot with Axis Dashboard with my own data, sadly I have been working on it for 2 weeks and no luck. Here are some of my main questions:

— I have to say I am rather confused on understanding which axis is which; for example on your Surface 1, Axis4_grid1 is labeled 0.03 and Axis4_grid1 is labeled 0.00 which really has threw me for a loop.
— I’d also love to know how you went about picking your parameter values for X top/bottom, Y top/bottom, and Z top/bottom.
— If I wanted to make the X and Z axes interchangeable via a parameter would that effect the parameter values for X top/bottom, Y top/bottom, and Z top/bottom (with respect to my data, once I understand how you selected those values)
— I followed your SQL query and was perplexed on your choice to use 0.33 and 0.66 to alter your x/y/z values; what is the significance? is it related to the fact there are to be 3 planes?
— And lastly, where is this data from? what is it/where did it come from?

I really hope to hear back from you on this. I understand it’s been some years since you’ve created these, but your help would be amazing.

Best,

Tatiana

12. Pingback: 3D модели в Tableau – COOL BLUE DATA