How to make a tree plot in Tableau | #WorkoutWednesday | 2019 |6

Well this looks fun and new! TREES?! In a viz? In a business-focused dashboard? Well let’s do this, I’m excited. Here’s a larger view of what we’ll be doing in this post. You can check out all the details and requirements, here.

Okay, so on the surface this is a dual axis chart with a column for each continuous WEEK( [Order Date] ) (we know this because of the date format at the bottom); and a row for each [Customer Segment]

We can also see a y-axis of number of orders with bar making up the tree trunk. And then we have the circles on each bar sized by the amount of sales. Each circle is an individual order. Lastly, we have a VIT (viz in tooltip) detailing each order by the sales and quantities by sub-category.

Let’s start building

Let’s put [Week of Order Date] on column and [Segment] on rows. While I’m here, I’m going to go ahead and set the default color for [Segment]. I can’t tell from the directions what colors Ann chose but it looks like she may have used the Hue Circle palette

Screen Shot 2019-02-06 at 3.12.15 PM

Screen Shot 2019-02-06 at 9.12.50 PM

Well, you can’t have a tree without a trunk so let’s start there. Those are just the number of orders for each week.

Screen Shot 2019-02-06 at 9.39.05 PM.png

Simple enough, right? Now for the slightly difficult part How do we get all of the individual orders.

Real talk: I spent more time than I’d care to admit figuring this out. I was SOOOO close to downloading Ann’s workbook to see how she did it but I said, “NO! Sean, you will figure this out!”

And then, just after I said that to myself, it hit me – THIS IS AN ANN JACKSON CHALLENGE! And that can only mean one thing. There will be table calculations involved. Oh yes, there WILL be table calculations.

Now, there are probably a couple ways to solve this but the one that first popped into my head was a running total. So when I duplicate my CNTD( [Order ID] ) we select the “running total” quick table calculation.

Screen Shot 2019-02-07 at 1.53.24 PM

But now we need to edit our table calc to ensure that we are computing our running sum along the [Order ID] field. And we also need to edit the sort order option because Ann said we need to order the orders descending by sum of sales

Screen Shot 2019-02-07 at 2.02.13 PM

Now the next thing to do is to put SUM( [Sales] ) on the size shelf of the circle marks card. and adjust the size and transparency and get them as close as you can

 

Sync the axis, remove the secondary axis header and move the table calc pill to be the main axis and…

Screen Shot 2019-02-07 at 2.11.59 PM

Now all that’s left on this sheet is to remove gridlines, edit the [Order ID] axis to start at zero, edit the fonts and sizing of the row labels and we’re ready to tackle the VIT.

Whenever you hover on any mark, [Order ID], a detailed breakdown of the order pops up.

Screen Shot 2019-02-07 at 2.18.38 PM.png

It’s crazy to think that viz in tooltips are only just now a year old. they were released in January 2018 with Tableau version 10.5!

Okay, we need to setup a new sheet with [Sub category] on rows and I’ll use Measure Names/Measure Values to select [Sales] and [Quantity] on columns and include a grand total for our Measure Values.

Screen Shot 2019-02-07 at 2.30.06 PM

Ann’s directions say to color the sales column orange sequentially by Sales and no color on the quantity column. Luckily this is really easy to do since Tableau allows us to put measure values on the color shelf and apply separate legends for each measure name.

Screen Shot 2019-02-07 at 2.51.36 PM

Now, we edit the sales color scale

screen-shot-2019-02-07-at-2.52.11-pm.png

to make it a custom orange sequential scale

Screen Shot 2019-02-07 at 2.53.00 PM

Now we also need to sort the view based on sales. So we end up with view like this

Screen Shot 2019-02-07 at 2.58.40 PM.png

and now to make the Quantity column have no color we, can do the same thing except we’ll do a DIVERGING scale and both of our colors will be #FFFFFF

Screen Shot 2019-02-07 at 3.02.08 PM

So now our view looks like this

Screen Shot 2019-02-07 at 3.05.16 PM.png

Now we’re ready to add it to the tooltip of our first sheet

Screen Shot 2019-02-07 at 6.33.07 PM

I set the max height to 100 pixels after some playing around to make it look just right.

And there you have it, just a bit more of minor formatting and it’s we’re all set!

Click the dashboard to see the interactive version

Happy Trees.png

GO FORTH AND VIZ!

 

 

Leave A Reply

Your email address will not be published.