Preparation time: 5 minutes
Level of difficulty: Easy
Objective: Make a donut chart
Creating a pie chart or pie chart is a great visualization classic. Tableau makes it very easy to do that. However, for a slightly more modern look, you may want to create a donut graph, which is nothing more and nothing less than a pie chart with a hole in the middle (it's a bit strange to say that, but we understand each other). Here is my recipe for a successful doughnut on Tableau.
• 1 measure (such as sales, profits)
• 1 dimension (categories, regions, etc.)
For this example, we're going to use the Hypermarket database that you'll find by default in Tableau Desktop (at the bottom of your screen when you open the software).
The size will allow you to divide the parts of the donut.
• Drag the dimension into the “Color” box on the coordinate system.
• Change the chart type to “Sector.”
• Drag your measure (for example, Sales) into “Columns.”
• Hold the CTRL key (or CMD on Mac) and drag the “Sales” measure into “Columns” again to duplicate it.
• Right-click on each of the measurement fields in “Columns” and select “Attribute” for both.
This is where the magic starts!
• Right-click on the second measure (in “Columns”) and select “Create a double axis.” This allows the two charts to be superimposed.
Now that you have two circles on top of each other, it's time to “dig” the donut hole.
• In the second coordinate system created (corresponding to the second pie chart), remove all fields present. This will empty the information in this chart.
• Then, select the white color in “Color” to create the center hole in your donut.
Finally, to perfect the donut effect:
• Go to the first coordinate system of the measure (the one that corresponds to your initial pie chart).
• Adjust the size of the pie chart by expanding it slightly to make the donut well-formed.
And here is a magnificent doughnut. To go a little further, you can add a value in the white part to use it as a KPI.