Sep
25
2016

Block Bar Donut chart in Tableau

 This article explains the basic concept of Block Bar Doughnut chart in Tableau.

Theory/Information:

This post is inspired by Adam Mccann work.  Here is a link to his version on his Tableau Public page .There are so many great vizzes are available on his Pages . Go and have a look Guys.

Creating the doughnut chart is relatively easy, but creating different sizes for the slices is not built in. Comparing values is one of the reasons why we make charts. So today I am going to teach you a handy little trick to make a block bar Doughnut like chart to compare targets with actual. This type of chart is very useful when you have a bunch of sales targets and you want to measure how the performance has been.

4

Step 1:

Donut or Doughnut chart is just a simple pie chart with a hole inside. You can define hole radius to any size you need. A doughnut Chart is divided into sectors, each sector (and consequently its central angle and area), is proportional to the quantity it represents. Together, the sectors create a full disk.Creating the doughnut chart is relatively easy, but creating different sizes for the slices is not built in inside Tableau. At first glance I seem to be stuck and struggled a lot.

I don’t know how to start at the beginning, though I know how I would do it .It took me couple of hours to hack it together and realized this chart is nothing but a clever use of inner and outer radius. Let’s start how we can make this chart inside Tableau.

The Block Bar Donut chart is actually a combination of 3 circles each having three different radius .Now we need to define the color legends in such a way so that we will get the thick donut chart as mentioned above.

1

Step 2:

Let’s prepare the Sample data set which help us in getting the desired shape. I think first we need to understand how to create our data set. As our Donut chart is made up of three circle and each circle contains some color which is appearing in the form of Pie. Let’s take an example of Circle 1(Point 1 & 2) which is a combination of “orange” color and “White“ color.

2

5

 

 

 

 

 

 

Step 3:

Now we know what sort of data we need to prepare. One column will be Unique “Composition/Points” which will help us in identifying the Color composition of each circle.The “Path” Column allows you to encode data by connecting marks using a particular drawing order. “Angle” will help us in determining the angular measure of the pie wedges. So when you place a measure such as “Angle” on Angle on the Marks card, the 360 degrees of the pie corresponds to the total sum of 1, and each wedge is divided by the values of the field on Color on the Marks card. “Circle color” is another column where we are defining the colors based on Points.

6

7

Step 4:

Open Tableau, Go to the main menu, click Data ➤ Connect to Data, and a list of data source will open. Choose Microsoft Excel and browse for the sheet which contains the desired data required to produce the donut chart. Create a calculated field “X axis” and put it into “Column” Shelf. When you divide the Path by Large number say 1000 or 1000000, it will make easy to fixed the Axis which will aligned the center of each Donut chart at the center.

8

Right click on the X axis and Fixed the Axis from2 to 2 .

9

Step 5:

Now Change the Marks from automatic to Pie. Drag “Path” measure on size shelf and “Angle” measure on Angle shelf. Now when you add a “Circle color” on Color Marks shelf, your Pie chart will look like the below image.

10

But we need a separate color for each Composition, how we gonna do that? Don’t worry, Tableau has so many unique Features? Let’s pick one feature to solve our Issue.

We will be using the “Combined Field” feature where we will combine “Circle color” and “Composition” dimension which will give us a unique Combination for all Colors.Now drag this newly created combined Field on color shelf and see the Magic.

11

12

Step 6:

Right click on the Arrow sign -> Edit Sizes -> Size Vary -> By Range (Adjust the Range). This will make the Pie chart more appealing.

13

Step 7:

Now assigned the proper color to the Color legends. Do some Formatting like remove Zero Lines, make the column and Row Border –-> None and lastly hide the header of X axis.

14

Now just create a Dual Axis by using the same measure X .First Duplicate the measure and make sure the Mark shelf contain the "Circle" Marks as highlighted below. Synchronize the axis and you will get the desired result.

16

 

 

 

 

 

 

 

 

 

 

Step 8:

Go to the Dashboard and add this sheet to the Dashboard .You can also use an image object on top of the Pie chart. Drag an image object ,this will open a directory, add a PNG background circle image and your work is done.

15

 

10

You can download the Image (Circle PNG image) by clicking below

circle-png-image

About the Author: Rajeev Pandey

I’m Rajeev, Tableau Ambassador, Tableau featured Author,Pro Tableau Tech Reviewer, Data Evangelist from Hyderabad, India. I am a multidisciplinary designer working in data visualization, interaction design and innovation. Expertised in developing Tableau , Web focus based visualization and reporting applications.I am quick learner who can absorb new ideas and can communicate clearly and effectively.I love creativity and enjoy experimenting with various technologies.

1 Comment+ Add Comment

  • Hey Rajeev,

    Nice post. Had fun re-creating the above at my end. But woud like to understand how to implement the same in the real-world scenario. How would be able to mark the points and assign the color as per.

Leave a comment

You must be logged into post a comment.