Tutorial (Tableau): Creating Donut Charts
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.

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: Create dummy fields
To begin, we create two dummy fields in the row shelf by typing the number "0″ twice, which Tableau will automatically transform into "SUM(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, we select the "Pie" item. 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 both the size "Category" and the size "Sales" as labels by dragging and dropping them to Label on 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: Transform to donut graph
To complete the first layer, we transform the pie chart to a donut graph 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 view by right-clicking on the second instance of the dummy variable SUM(0) in the rows 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: Customizing the view
Finally, let's customize 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.

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
Posso usare più di 5 categorie in un grafico a ciambella?
Idealmente no, per mantenere la chiarezza del grafico.
Come posso migliorare la leggibilità delle etichette in un grafico molto affollato?
Considera l'utilizzo di una legenda esterna o di tooltip interattivi.
È possibile visualizzare dati di serie temporali in un grafico a ciambella?
No, per dati di serie temporali sono più indicati altri tipi di grafici come quelli a barre o linee.
Che cosa è un campo dummy?
Un campo "dummy" (o campo fittizio) in Tableau, così come in altre piattaforme di analisi e visualizzazione dei dati, è un campo creato per servire uno specifico scopo tecnico o di visualizzazione, piuttosto che per rappresentare direttamente i dati sottostanti. Questi campi sono spesso utilizzati come strumenti per facilitare o abilitare determinati tipi di analisi o visualizzazioni che altrimenti non sarebbero possibili o sarebbero molto più complessi da realizzare. Nel contesto di questo tutorial, abbiamo usato il termine "campo dummy" per descrivere i campi creati con l'unico scopo di impostare una struttura su cui costruire il grafico a ciambella in Tableau.
Vorrei imparare ad usare Tableau, quali sono le migliori risorse online?
A livello gratuito si può fare riferimento direttamente alle risorse messe a disposizione da Tableau. A pagamento, il corso "Data Analyst in Tableau" su Datacamp ti permetterà di conoscere appieno questo strumento, oltre a prepararti alla certificazione "Tableau Data Analyst". Last but not least, puoi contattarmi qualora tu preferisca una formazione one-to-one (in modalità online oppure in presenza nel caso di aziende).
Stay updated or let us talk
Subscribe to the newsletter for practical guides on WordPress, security and accessibility, or tell me about your project.



