Tutorial (Tableau): Creating Donut Charts

Tools used in this project:
Tableau
Difficulty level:
Beginner

Understanding and presenting complex data intuitively is crucial for a data analyst. Donut Charts offer a visually appealing way to represent part-whole relationships in our data. This short tutorial will examine the various steps required to create them with Tableau.

Donut Chart - Categories

Understanding pie charts

Before delving into the universe of doughnut charts, it is crucial to clearly understand a simpler version of them: the pie chart.

Imagine a pie chart as a method of demonstrating how various categories or segments make up a whole. As the name suggests, it resembles a cake divided into several segments, each representing a fraction of the whole.

For example, the following simple pie chart shows the distribution between cash and credit card payments in a restaurant. Since credit card payments occupy the largest share, they indicate which payment customers prefer.

This demonstrates the effectiveness of pie charts in showing the relationship between the parts and the whole, making it easier to compare the distribution of the various categories. Importantly, you should only opt for a pie chart if you have less than five categories. For higher numbers, a bar chart would be more appropriate.

Donut charts

A donut chart serves a similar purpose to a pie chart, but offers an additional level of understanding by showing how the various categories contribute to a total. The main difference lies in the ‘hole’ in the centre, which adds an aesthetic layer and can accommodate additional information.

Where to use them

Donut charts are ideal for conveying part-whole relationships in your data. Some commercial applications of doughnut charts include:

  • Sales analysis: display the distribution of sales by category.
  • Budget management: shows how expenses are allocated.
  • Representation of market share: highlighting the market proportions held by different competitors.
  • Analysis of survey responses: summarising responses to questions with multiple options.

Donut chart construction in Tableau

Let us imagine analysing the Superstore dataset pre-installed in Tableau to explore how total sales are distributed in percentage terms between the three main categories: Furniture, Office Supplies, and Technology. Using a doughnut chart, we can visualise the share of sales in each category and highlight total sales clearly and intuitively.

Step 1: Creating Dummy Fields
To begin with, we create two dummy fields in the row shelf by typing the number ‘0’ twice, which Tableau will automatically transform into (0). These will act as position indicators for our doughnut chart.

Step 2: Creating the Pie Chart
From the drop-down menu of the Marks ‘All’ tab, select the entry ‘Pie’. Next, to populate the graph with data, we move to the dummy tab SUM(0), drag the dimension ‘Category’ to ‘Colour’ and the measure ‘Sales’ to ‘Angle’, and set the view from ‘Standard’ to ‘Entire View’.

Step 3: Adding Labels
To distinguish each slice, we add the size ‘Category’ and the size ‘Sales’ as labels by dragging them to Label in the Marks tab. To clearly show the percentage contribution of each category to total sales, we convert ‘Sales’ to a percentage by using the drop-down menu next to the label and selecting ‘Quick Table Calculation’ > ‘Percent of Total’.

Step 4: Transformation into a Donut Chart
We transform the pie chart into a doughnut chart to complete the first layer by incorporating the second. We select the third and last dummy field, SUM(0) (2), from the Marks tab and set the circle’s colour to white. This will create the effect of a hole in the centre of the pie chart. We then drag the measure ‘Sales’ onto the Label tab to display the total sales.

Step 5: Combining the layers
We combine the layers to form a single display by right-clicking on the second instance of the dummy variable SUM(0) in the row shelf and selecting ‘Dual Axis’. We can now adjust the size of the pie chart and the centre circle according to our preferences.

Step 6: Customising the visualisation
Finally, we customise the formatting and design of our doughnut chart:

  • Uncheck “Show Header” by right-clicking on the y-axis.
  • We add the currency symbol on the central value for total sales and change the size to improve readability:
  • We remove the borders from the view, with ‘Row Divider’, ‘Column Divider’ and ‘Zero Lines’ both set to ‘None’:
  • We set the percentages in the graph categories to one decimal place:
  • Let us set the Tooltip:
  • Let us give the worksheet a title:
  • Finally, we add a white divider border to the graph sections:

Thus, we have created a clear and compelling donut chart showing how sales are distributed between the categories of ‘Furniture’, ‘Office Supplies’, and ‘Technology’ in the Superstore dataset while providing an immediate view of total sales. This visualisation is beneficial for quickly identifying areas of strength and improvement in sales distribution.

Recommendations when using a donut chart

What to do:

  • Maintain a limited number of categories.
  • Use distinct colours.
  • Clearly label each category.
  • Provide supporting indications, e.g. using tooltips.

What not to do:

  • Avoid 3D effects and ‘exploded slices’.
  • Do not use it for large data sets.
  • Avoid comparing similar sizes.
  • Not suitable for time series data.
Dashboard Tableau Donut Charts

Note: The dashboard is available for download on my page on Tableau Public.

Conclusions

Donut charts are a powerful visual tool for presenting data, provided they are used correctly. By following the proposed guidelines, you can create compelling and informative visualisations.

FAQ

News tag:
Scroll to Top