4 min read

[box type=”note” align=”” class=”” width=””]This article is an excerpt from a book written by Shweta Sankhe-Savale titled Tableau Cookbook – Recipes for Data Visualization. This cookbook has simple recipes for creating visualizations in Tableau. It covers the fundamentals of data visualization such as getting familiarized with Tableau Desktop and also goes to more complex problems like creating dynamic analytics with parameters, and advanced calculations.[/box]

In today’s tutorial, we will learn how to create a Treemap and a packed Bubble chart in Tableau.

Treemaps

Treemaps are useful for representing hierarchical (tree-structured) data as a part-to-whole relationship. It shows data as a set of nested rectangles, and each branch of the tree is given a rectangle, which represents the amount of data it comprises. These can then be further divided into smaller rectangles that represent sub branches, based on its proportion to the whole.

We can show information via the color and size of the rectangles and find out patterns that would be difficult to spot in other ways. They make efficient use of the space and hence can display a lot of items in a single visualization simultaneously.

Getting Ready

We will create a Treemap to show the sales and profit across various product subcategories. Let’s see how to create a Treemap.

How to Do it

  1. We will first create a new sheet and rename it as Treemap.
  2. Next, we will drag Sales from the Measures pane and drop it into the Size shelf.
  3. We will then drag Profit from Measures pane and drop it into the Color shelf.
  4. Our Mark type will automatically change to show squares. Refer to the following image:

Treemap and Packed Bubble chart in Tableau

5. Next, we will drop Sub-Category into the Label shelf in the Marks card, and we will get the output as shown in the following image:

Treemap in Tableau

How it Works

In the preceding image, since we have placed Sales in the Size shelf, we are inferring this: the greater the size, the higher the sales value; the smaller the size, the smaller the sales value.

Since the Treemap is sorted in descending order of Size, we will see the biggest block in the top left-hand side corner and the smaller block in the bottom right-hand side corner.

Further, we placed Profit in the Color shelf. There are some subcategories where the profit is negative and hence Tableau selects the orange/blue diverging color.

Thus, when the color blue is the darkest, it indicates the Most profit. However, the orange color indicates that a particular subcategory is in a loss scenario.

So, in the preceding chart, Phones has the maximum number of sales. Further, Copiers has the highest profit. Tables, on the other hand, is non-profitable.

Packed Bubble Charts

A Packed bubble chart is a cluster of circles where we use dimensions to define individual bubbles, and the size and/or color of the individual circles represent measures. Bubble charts have many benefits and one of them is to let us spot categories easily and compare them to the rest of the data by looking at the size of the bubble. This simple data visualization technique can provide insight in a visually attractive format.

The Packed Bubble chart in Tableau uses the Circle mark type.

Getting Ready

To create a packed bubble chart, we will continue with the same example that we saw in the Treemap recipe. In the following section, we will see how we can convert the Treemap we created earlier into a Packed Bubble chart.

How to Do it

  1. Let us duplicate the Tree Map sheet name and rename it to Packed Bubble chart.
  2. Next, change the marks from Square to Circle from the Marks dropdown in the Marks card. The output will be as shown in the following image:

Bubble chart in Tableau

How it works

In the Packed Bubble chart, there is no specific sort of order for Bubbles. The size and/or color are what defines the chart; the bigger or darker the circle, the greater the value.

So, in the preceding example, we have Sales in the Size shelf, Profit in the Color shelf, and Sub-Category in the Label shelf.

Thus, when we look at it, we understand that Phones has the most sales. Further, Copiers has the highest profit. Tables, on the other hand, is non-profitable even though the size indicates that the sales are fairly good.

We saw two ways to visualize data by using Treemap and Packed Bubble chart types in Tableau.

If you found this post is useful, do check out the book Tableau Cookbook – Recipes for Data Visualization to create more such charts, interactive dashboards and other beautiful data visualizations with Tableau.

Tableau Cookbook – Recipes for Data Visualization

 

 

 

Content Marketing Editor at Packt Hub. I blog about new and upcoming tech trends ranging from Data science, Web development, Programming, Cloud & Networking, IoT, Security and Game development.

LEAVE A REPLY

Please enter your comment!
Please enter your name here