The One Use Case for 3D Elements in Tableau (and How to Create Them)

Oct 9, 2019

Klaus Schulte

3D charts are widely regarded as bad practice in the context of visualizing data. 3D adds no additional information. On the contrary, it clutters the viz and often complicates the visual perception of information.

It can only get worse when you add bananas. 🍌

However, you can of course create 3D elements in Tableau. But for me, the one and only use case you should actually use them is when you do not need to display quantitative information accurately and 3D is just a design element in your viz.

This is something Samuel Parsons did for example in his stunning #IronViz feeder Sowing Seeds in America from earlier this year. He created this nice 3D element to connect his map with the bar chart. The quantitative information however is only represented in the bottom part. There is a common base line and the reader can perceive the information accurately. What a beauty, Sam!

Sowing Seeds in America by Samual Parsons

For the #BelgiumTUG logo contest I created a 3D bar chart. Again there is no accurate quantitative information I wanted to display here, there are just longer and shorter fries 🙂

Sure, most of you won’t ever feel the need to create a 3D fries chart. Nevertheless, I thought this little project was worth a blog post to describe the steps I went through. Because it is a good example to learn and understand how to draw in Tableau. Gaining a deep understanding of how to draw in Tableau will allow you to create anything you want in Tableau. Even 3D elements!

Note: Drawing in Tableau is something Ludovic Tavernier and I talked about in our session at Tableau Conference Europe and Ivett Kovacs and I will also talk about in our session at Tableau Conference in November.

Ok, let’s start!

About the Project

The Logo Contest

Saturday morning, I received a message from Marian Eerens. I had met Marian three days earlier at a meetup of the Netherlands Tableau User Group in Eindhoven and we were talking about the #BelgiumTUG. Marian is a co-leader of this new TUG and, together with her co-leaders, she has launched a logo contest, inviting the Tableau community to create a logo for the TUG.

I had made a joke that evening in Eindhoven that I was thinking about creating a fries chart, to pay tribute to the inventors of fries.

Well, such a nice message, I just could not say no!

Inspiration

To get some inspiration, I searched the internet for some fries advertising posters and borrowed some of the elements I found. The circle in the middle of my logo symbolizing a plate, the red container (although it looks a little bit McDish) and of course the 3D fries.

3D Fries Chart

Proof of concept

After creating a first quick chart with Superstore sub-category sales, I knew this could work (Some sub-categories had very small values, I therefore added 100,000 directly in my sales pill.).

It needed a continuous x-axis to let my fries overlap. I therefore calculated the x-coordinate for each sub-category with a case statement. I could have also used index() here, but I wanted to avoid table calculations.

Sketching the 3D bar

To create my 3D Polygon Fries, I first created a sketch. While my proof of concept was a bar chart, I had only one mark sitting center aligned at the top of my bar (black dot). For a 3D bar I would need eight points (red dots).

So I had to do some data densification first. I leveraged the internal data densification method here and created two fields IDD1 (for the front and the side of the bar) and IDD2 (for having four points on both ‘sides’ of the bar):

IDD1 = DATEPART('month',[Order Date]) %2
IDD2 = 
CASE YEAR([Order Date])
 WHEN 2016 THEN 1
 WHEN 2017 THEN 2
 WHEN 2018 THEN 3
 WHEN 2019 THEN 4
END

This created 8 valid partitions for each of my 17 sub-categories.

I then calculated a fixed LOD to get back my original sales:

Sales LOD = { FIXED [Sub-Category]:SUM([Sales])}+100000

Never heard of Internal Data Densification? Then check out Rosario Gauna’s and my Manifesto of Internal Data Densification!

The X-Value

First, I created a field ‘size’ that gave me out three different widths for my fries based on a parameter ‘Size Fries’.

The size field:

According to my sketch I was then able to calculate the position of each point (IDD2) on each side of my 3D bar (IDD1) using ‘x (Sketch)’, ‘size’, and ‘Shadow X’.

The Y-Value

For the Y-value I used the Sales LOD field and a parameter ‘Shadow Y’ and again calculated the position for each of my partitions according to my sketch.

Creating the Viz

Creating the viz was then quite easy and I ended up setting my parameters like this:

Different layouts can be achieved easily by changing the parameters:

For the 3D effect, I colored the sides in a slightly darker yellow. I also did this for the bars in the last row.

That’s it!

Wrap Up

Writing a tutorial to create 3D charts in Tableau might be controversial. So please keep in mind what I said at the beginning of this post: Don’t use them when you want to display quantitative information accurately.

For all other use cases take this and add another dimension to your visualizations!

I hope you enjoyed reading and I’m looking very much forward to your comments below. You can also reach out to me on Twitter (@ProfDrKSchulte).