Skip to main content
HomeTutorialsTableau

How to Create a Useful Tableau Donut Chart

Create a Tableau donut chart by following simple steps for importing data, resizing, and customizing colors. Learn formatting tips and advanced options. See their advantage over pie charts.
Sep 26, 2024  · 8 min read

Tableau is an industry leader in data visualization. Not only does it provide many great pre-set visualizations, but if you master it, you can extend its functionality in many different directions, including by creating new visualizations that aren’t part of the standard library. 

In this article, we will look closely at how to make a donut chart in Tableau. After reading this article, consider enrolling in our Tableau Fundamentals skill track to learn more about what Tableau has to offer. 

What is a Tableau Donut Chart?

A donut chart is similar to a Tableau pie chart, but with the notable feature that it has a hole in the middle, so it looks like a donut. This subtle change is more interesting than it seems. In my opinion, donut charts prove to be a little bit of a better option because leaving the center open changes how we see the slices.

The problem with a pie chart is that, instead of just looking at the angles, we also focus on the lengths of the slices, which can be more confusing or give a contradictory impression. And according to studied basic data visualization principles, differences between lengths tend to be perceived more accurately than differences between angles. So while both charts help us see relative composition by encoding the underlying numerical data as angles of a complete circle, the donut chart adds clarity by shifting our attention from the angles to the lengths of the slices.

When to Use a Tableau Donut Chart

Let’s consider, as a set of rules, the conditions under which a donut chart would be insightful:

  • Use donut charts with percentages only.
  • Percentages in a donut chart must add up to 100%.
  • Percentages in a donut chart must be positive.
  • Limit the slices in pie charts to 2-3 slices max (more slices tend to be crowded and confusing).
  • Do not use 3D donut charts (they become even more confusing).
  • Always start the first slice at a zero-degree angle (at a 12 O’clock position).
  • Always sort the categories (slices) according to their importance in a clockwise order.
  • Now, let’s move on to the hands-on part!

Steps to Create a Donut Chart in Tableau

Tableau does not have a donut chart from which to choose directly. Instead, we need to do a little trick to create our own donut chart. The trick mainly consists of creating a pie chart and then placing a smaller white circle over the center of the pie. So, let’s import our data and see how that works!

Import data into Tableau

For this tutorial, we will use “Hollywood's Most Profitable Stories” dataset, available as a CSV file, in Tableau’s sample datasets page. Download the file onto your device.

Downloading Hollywood's Most Profitable Stories dataset

Downloading Hollywood's Most Profitable Stories dataset. GIF by Author.

Then, we will import the dataset. Since this is a CSV file, we will use the “Text file” connector in Tableau Public (or Desktop) opening page.

Importing data into Tableau

Importing the dataset into Tableau. GIF by Author.

After importing the dataset, pay special attention to the Genre, Worldwide Gross, and Year columns, as these are the ones that we are going to work with. Worldwide Gross shows the yearly profit that each movie generates all over the globe.

Create a pie chart

Suppose that we are interested in visualizing the percentage of profit that each movie genre generated. This is a perfect part-to-whole case where donut charts are useful.

As we said, to create a donut chart in Tableau, we first need to create a pie chart. We can do so through the following steps:

  1. First of all, change the Marks type from Automatic to Pie.
  2. Drag the Genre field onto the Color card.
  3. Drag the Worldwide Gross field onto the Angle card (only available if you have changed the Marks type to Pie).

How to create a pie chart in Tableau

How to create a pie chart in Tableau. GIF by Author.

If you hover over the pie chart slices, you will see Worldwide Gross shown as a number. We will edit this later, but for now, let’s turn this number into a percentage. We can do so by:

  1. Right-clicking on the Worldwide Gross field in the Angle card.
  2. Go to Quick Table Calculation.
  3. Choose Percent of Total.

Showing percentage of total in a pie chart tooltip in Tableau

Showing percentages in a pie chart tooltip. GIF by Author.

Converting pie chart to donut chart

Now, the fun part! Let’s do the trick that will turn our pie chart into a donut. The idea here is to create a circle below the pie, place it over the pie chart at the center, and then reduce the circle size so it would appear as a hole in the middle.

So, how can we create another circle below the pie chart? Remember that everything in Tableau mainly depends on vertical and horizontal axes. We need to create two identical vertical axes, one for the pie and one for the middle circle, and then combine them into one.

To create a vertical axis, we need to place a variable on the Rows shelf; to create two identical vertical axes, we need to place that same variable twice on the same shelf. 

You might be wondering which variable we should use. The most straightforward answer is to create a dummy variable with a value of zero. To do this:

  1. Click on the small downward arrow in the part of the left-side pane next to the search bar.

  2. Choose Create Calculated Field….

  3. In the calculated field text box, write 0. Let’s name this as Donut Middle Circle.

  4. Click OK.

Creating a dummy variable for the donut chart in Tableau

Creating dummy variable for the donut chart. GIF by Author.

For our next steps:

  1. Drag and drop the Donut Middle Circle variable twice onto the Rows shelf.  You will see that we now have two pie charts.
  2. Right-click on the second Donut Middle Circle variable on the Rows shelf, and choose Dual Axis. Notice that the second pie chart has overridden the first.
  3. In the Marks box, you will notice that you now have two Marks options in addition to the first All one. Click on the last Marks option.
  4. Take out the Genre from the category. Notice that the overlaying pie has turned into a solid-colored circle.
  5. Reduce the size of the overlaying circle by clicking on the Size mark and make it smaller.
  6. In order for it to be like a hole, change the color of the circle to white, the background color in this case.

Converting the pie chart into a donut chart in Tableau

Converting the pie chart into a donut chart. GIF by Author.

And there you have your donut chart! What is left is a matter of formatting to bury the trails of our trick, that is to hide the axes and take out the zero line and the horizontal and vertical borders around the donut. To do so:

  1. First, right-click on either of the two axes headers.
  2. Click on Show Header to uncheck it.
  3. Right-click anywhere in the view.
  4. Choose Format.
  5. In the Format pane on the left side, go to Lines.
  6. Under the Sheet tab, set the Zero Lines to None.
  7. Go to Borders.
  8. Under the Sheet tab, set the Row Divider and the Column Divider panes to None.

Converting the pie chart into a donut chart with formatting in Tableau

Converting the pie chart into a donut chart with formatting. GIF by Author.

How to Customize the Tableau Donut Chart 

We have successfully created our donut chart. The next step is to make sure it looks nice.

Adjusting size

You may have noticed that, by default, the donut chart is pretty small. This is because our donut chart view is set to Standard view, meaning that its size will always be the same, even when our dashboard has a lot of space.

I don't think the Standard view is the best with donut charts. We want our donut chart to fill the entire space it has. So, we will change the Standard to Entire View. We then adjust the Size card and using the slider. As a final note, since we have two Marks cards, one for the underlying pie and one for the superimposed circle, we will have to repeat these steps for both.

  1. Click on the Size card.
  2. Drag the slider to the right and see how the pie or the white circle gets larger.

Adjusting the donut chart size through the Size card in Tableau

Adjusting the donut chart size through the Size card. GIF by Author.

Adjusting colors

Like in any chart in Tableau, we can change the colors of the chart through the Color card. In order to make our coloring purposeful, let’s assume we are mainly concerned with highlighting the share of profit that the comedy genre generates. In this case, we will give the “Comedy” slice a highlighting color and the other slices a muted grey color.

  1. Click on the first Marks card to control the underlying pie.
  2. Click on the Color card.
  3. Choose Edit Colors….
  4. Double-click on Comedy and choose a distinctive color.
  5. Click OK.
  6. Repeat the previous two steps with the other genres, giving them all the same degree of grey.

Adjusting donut chart colors in Tableau

Adjusting donut chart colors. GIF by Author.

Adjusting slices order

Now, we have Corporate as the highlighted slice, but it is not sorted first in a clockwise order, as we advised at the beginning of the tutorial. So, what we need now is to modify the sorting of the segments. To do so:

  1. Click on the first Marks card for the underlying pie.
  2. Right-click on the Genre field in the Color card.
  3. Choose Sort….
  4. In the Sort window, choose Sort By to be Manual.
  5. Click once on Comedy and click on the upward arrow with a hat to Move to top.
  6. Exit the Sort window.

Adjusting donut chart slices order in Tableau

Adjusting donut chart slices order. GIF by Author.

Modifying tooltip

So far, the tooltip that shows up when we hover over any part of our donut chart is not very viewer-friendly. We have two tooltips that show up. The first is when we hover over the actual slices coming from the base pie, and the other is when we hover over the middle circle.

Since we want the middle circle to be a hole, we won't need it to have a tooltip at all. To turn off the middle circle’s tooltip:

  1. Click on the second Marks card to control the overlying circle.
  2. Click on Tooltip.
  3. In the Edit Tooltip text window, simply delete the text.
  4. Click OK.

Turning off the donut chart’s middle circle’s tooltip in Tableau

Turning off the donut chart’s middle circle’s tooltip. GIF by Author.

As for the tooltip that is applied to the slices, we can make several adjustments to make it more readable and polished. First, we can reduce the number of the profit percentage decimal places:

  1. Click on the Marks card of the underlying pie.
  2. Right-click on the Worldwide Gross field in the Angle card.
  3. Choose Format….
  4. In the formatting pane on the left side, go to Pane tab.
  5. Change the format of the Numbers in the Default section to Percentage, and decrease the decimal places to zero.

Formatting percentages in the tooltip in Tableau

Formatting percentages in the tooltip. GIF by Author.

Second, we can also add the Worldwide Gross as the total number for reference. Then, we will format it as currency:

  1. Click on the Marks card of the underlying pie.
  2. Drag the Worldwide Gross field once again but drop it into the Tooltip card this time.
  3. Right-click on the Worldwide Gross tab of the tooltip that you just placed.
  4. Choose Format….
  5. In the formatting pane on the left side, go to Pane tab.
  6. Change the format of the Numbers in the Default section to Currency (Custom), and decrease the decimal places to zero.

Adding total profit in currency to the tooltip in Tableau

Adding total profit in currency to the tooltip. GIF by Author.

Finally, we can rewrite and format the tooltip, by:

  1. Clicking on the Tooltip mark of the underlying pie Marks card.
  2. Writing the text that we want to show up in the tooltip. You can insert the variables in the text through the Insert button in the upper part of the Tooltip window.
  3. Let’s highlight the genre name and its share of profit by making them bold and in a distinctive color.
  4. Click OK.

Editing tooltips in Tableau

Editing the tooltip. GIF by Author.

Showing and adjusting labels

We can also show labels on the slices of the donut chart. Let’s assume we want to show the name of the genre in a proper font type and a relevant color:

  1. Click on the Marks card of the underlying pie chart.
  2. Drag the Genre field onto the Label card.
  3. Click on the Label card.
  4. Change the font type and color. You can also select Match Mark Color to make the label match its slice color.
  5. In the Marks to Label section, make sure All is chosen.

Showing and formatting labels on donut charts in Tableau

Showing and formatting labels on donut charts. GIF by Author.

Advanced Customizations to Further Enhance the Tableau Donut Chart

In addition to the usual formatting done above, we can do further customizations in Tableau to enhance our donut charts.

Grouping “Others” category

One of the tricks that can be handy with donut charts is to group the categories or slices, other than the one in focus, under one Others slice. This can be especially useful if we have too many categories, resulting in too many slices in the donut chart.

In our example, we can combine the categories other than Comedy in one Others category. This will make our donut chart have two slices instead of six, one for Comedy and one for Others.

  1. Right-click on the Genre field in the left side pane.
  2. Go to Create and then Group….
  3. In the Create Group window, select all genres other than Comedy, and then click on Group button.
  4. Name the newly created group as Others.
  5. Click OK.
  6. In the Marks card of the underlying pie, drag the newly created Genre (group) from the left side pane onto the Color and the Label cards.
  7. Take out the Genre from the Label card.
  8. Now, you would need to re-adjust the coloring of the slices and to introduce the new Genre (group) variable in the tooltip like what we did before.

Creating and visualizing the “Others” group in Tableau

Creating and visualizing the “Others” group. GIF by Author.

Adding a center text

One of the advantages of donut charts is that they provide a space for text at the center, which can be used for different purposes. Here, I will show how to add a label for the overlaying white circle.

First, we can use this circle to show the total profit of all genres just as a test. To do so, simply drag the Worldwide Gross field to Label in the Marks card of the white circle.

But we will not do that. Instead, we will take an extra step to show the profit of only the Comedy genre. To do so, we will need to create a calculated field that gives as its output the sum of comedy profits only.

You can follow the same steps of creating a calculated field mentioned earlier in this tutorial. For the field’s formula, we will write a formula that checks if the genre is comedy and sums up its profits. Let’s call this field Comedy Profit:

SUM(IF [Genre] = 'Comedy'
    THEN [Worldwide Gross]
    END)

Then:

  1. Place the new Comedy Profit field onto the Label of the white circle’s Marks card.
  2. Edit the label to also include the word Comedy, and do the proper text formatting.
  3. Format the Comedy Profit field number as currency, decreasing the decimal places and adding an m suffix, like what we did before.

  4. Take out the labels of the slices.

Adding a central text to donut charts in Tableau

Adding a central text to donut charts. GIF by Author.

Applying filters and looping pages

Like any other view in Tableau, we can apply filters on donut charts. Suppose, in our case, we want to filter the genre profits according to the year. First, we will need to change the data type of the Year field to String, and then:

  1. Drag and drop the Year field in the Filters box.
  2. Choose a year, and click OK.
  3. To show the filter control, right click on the Year field in the Filters box, and click Show Filter.

Adding filters to donut charts in Tableau

Adding filters to donut charts. GIF by Author.

Alternatively, we can also place the Year in Pages box to be able to flip between the years and see how the profit from comedy movies changed over the years.

Adding “Pages” to donut charts in Tableau

Adding “Pages” to donut charts. GIF by Author.

The resulting animated donut chart would look like this:

Animated donut chart in Tableau

Animated donut chart. GIF by Author.

Resources and Further Learning

In this tutorial, we saw how to create an informative and engaging donut chart in Tableau. All we needed to do was to create a pie chart first, and then do a trick to place a smaller white circle over the center of the pie. In addition to this, we also saq how to apply different formatting and customizations to make a donut chart look right.

DataCamp offers many tutorials on Tableau, like this one on how to create a waterfall chart in Tableau. It also offers a wide range of courses on Tableau, organized into a Tableau Fundamentals and Data Analyst in Tableau skill track and career track. Make sure to check them out!

Master Tableau From Scratch

Accelerate your career with Tableau—no experience required.

Start Learning for Free

Photo of Islam Salahuddin
Author
Islam Salahuddin

Islam is a data consultant at The KPI Institute. With a journalism background, Islam has diverse interests, including writing, philosophy, media, technology, and culture.

Topics

Learn Tableau with DataCamp

Course

Analyzing Data in Tableau

8 hr
54.1K
Take your Tableau skills up a notch with advanced analytics and visualizations.
See DetailsRight Arrow
Start Course
See MoreRight Arrow
Related

tutorial

Tableau Pie Chart: Your Go-To Guide

Create compelling pie charts in Tableau with clear step-by-step instructions for importing data, adjusting sizes, and customizing colors. Discover advanced methods like grouping categories and adding filters.
Islam Salahuddin's photo

Islam Salahuddin

8 min

tutorial

How to Create Stacked Bar Charts in Tableau

This tutorial explains the steps and best practices for creating a stacked bar chart using Tableau, from connecting data to creating the chart and making customizations!
Tim Lu's photo

Tim Lu

21 min

tutorial

Tableau Tutorial for Beginners

Learn to build dynamic dashboards and create compelling stories in Tableau using real-world datasets in this step-by-step tutorial for beginners.
Eugenia Anello's photo

Eugenia Anello

13 min

tutorial

How to Create a Waterfall Chart in Tableau

Enhance your data analysis skills and learn how to build and customize a waterfall chart in Tableau
Eugenia Anello's photo

Eugenia Anello

8 min

tutorial

How to Create a Dashboard in Tableau

Understand the importance of creating dashboards and learn to build a simple Tableau dashboard by following a visual guide.
Abid Ali Awan's photo

Abid Ali Awan

16 min

code-along

Dashboard Design Best Practices in Tableau

In this live Tableau training, you'll leverage the right tools to design reports. Using a video game dataset, you will learn how to customize charts, use themes, and some best practices when working on data visualizations.
Carl Rosseel's photo

Carl Rosseel

See MoreSee More