How to Create a Donut Chart in Tableau with AI
Building a donut chart in Tableau might feel like a hidden trick, since there's no one-click option in the "Show Me" panel. But don't worry - creating this clean and effective visualization is entirely possible and simpler than it looks. This tutorial will guide you step-by-step through the process, transforming a standard pie chart into a sleek donut chart with a key metric right in the center.
What is a Donut Chart and Why Use It?
A donut chart is essentially a pie chart with its center cut out. Both charts excel at showing the relationship of parts to a whole, like how different product categories contribute to total sales or which traffic sources make up your website visits. Where the donut chart gains an edge is its empty center. This space is prime real estate for displaying a key performance indicator (KPI), like the total sales figure or the overall number of website sessions. By placing the total in the middle, you provide immediate context for the surrounding slices, giving your audience two insights in one view: the breakdown and the grand total.
However, like pie charts, donut charts have limitations. They become cluttered and difficult to interpret if you have too many categories. As a best practice, try to limit your donut chart to no more than six slices. If you have more categories than that, a bar chart is usually a better alternative for clear comparison.
The Tableau Trick: Combining Two Charts into One
The secret to building a donut chart in Tableau lies in a clever technique called a dual-axis chart. You aren't actually creating a donut shape directly. Instead, you're doing the following:
You create a standard pie chart that represents your categorical data.
You create a second, smaller circle chart, colored to match your dashboard's background (usually white).
You place the solid circle directly on top of the pie chart.
The result is the illusion of a pie chart with a hole in it - a donut chart. Once you understand this core concept, the steps become much more intuitive.
Step-by-Step: How to Create a Donut Chart in Tableau
Let's walk through the process using a sample dataset. Imagine we have sales data for an online store and we want to visualize sales contribution by Product Category. Our data has two simple columns: Product Category (a dimension) and Sales (a measure).
Step 1: Get the Basic Structure Ready
The foundation of this chart starts in the Rows shelf. Instead of dragging fields there, we create a placeholder calculation that will let us build two separate charts in the same view.
Double-click in an empty area of the Rows shelf.
Type
MIN(0)and hit Enter.Do it again. Double-click to the right of the first pill and type
MIN(0)a second time.
You should now see two AGG(MIN(0)) pills in your Rows shelf and two horizontal lines across your canvas. Each of these pills now has its own Marks Card below, labeled AGG(MIN(0)) and AGG(MIN(0)) 2. This setup allows us to control two different charts independently.
Step 2: Build the Outer Ring (The Pie Chart)
Now, let's turn the first placeholder into our main pie chart.
On the Marks shelf, click on the first
AGG(MIN(0))tab.Change the mark type from Automatic to Pie using the dropdown menu.
Drag your dimension (e.g.,
Product Category) onto the Color tile.Drag your measure (e.g.,
Sales) onto the Angle tile.
At this point, you'll see a basic pie chart appear in the top half of your view. You can use the Size slider to make it bigger if it looks too small.
Step 3: Create the Donut Hole (The Circle)
Next, we'll build the object that will become the hole in our donut.
Click on the second Marks card tab, labeled
AGG(MIN(0)) 2.The mark type should already be set to Circle, which is what we need. If not, select Circle from the dropdown.
Click on the Color tile and select white (or whatever color your dashboard background is).
Now, click on the Size tile. You'll want to adjust the slider to make this circle slightly smaller than the pie chart. You can fine-tune this later, but for now, just make it visibly smaller.
You now have a pie chart in the top half of your screen and a solid white circle in the bottom half.
Step 4: Combine the Charts with a Dual Axis
This is where the magic happens. We're going to layer the white circle on top of the pie chart.
Go back to the Rows shelf.
Right-click the second
AGG(MIN(0))pill and select Dual Axis from the menu.
Your two charts will now be superimposed. It might not look correct just yet, but we're almost there! You'll also notice two "0.0" axes on the left and right sides of your view.
To clean up the view, right-click on one of the axes (the black "0.0" heading) and uncheck Show Header. Repeat for the other axis.
Remove the "zero lines" that may be showing through your chart by going to the menu bar -> Format -> Lines. In the Format pane that opens on the left, go to the 'Sheet' tab and turn off 'Zero Lines'.
Step 5: Add a KPI to the Center
The biggest advantage of a donut chart is using the center to display a key metric. Let's add the total sales figure there.
Make sure you are still on the Marks card for the second shape (the circle),
AGG(MIN(0)) 2. This is important, as you're adding a label to the circle, not the pie slices.Drag your measure (
Sales) from your data pane onto the Label tile on this Marks card.
A number representing the total sales will appear in the middle of your donut chart! You can format this to make it stand out.
Click the Label tile on the
AGG(MIN(0)) 2Marks card.Click the three dots (...) next to the "Text" field to open the editor.
Here, you can make the font bigger, change the color, make it bold, and add descriptive text around the number. For instance, you could write "Total Sales" on one line and have the
<SUM(Sales)>field on the next.
Step 6: Final Polish and Formatting
The functionality is complete, but let's add a few final touches to make it look professional.
Add Labels to Slices: Click on the Marks Card for the first pill (the pie chart). Drag your measure (
Sales) to the Label tile here. To display it as a percentage, right-click theSUM(Sales)pill on the label, select "Quick Table Calculation," and choose "Percent of Total."Tooltip Clean Up: Hover over a slice of your donut. The default tooltip might show "AGG(MIN(0)): 0." and some other details aren't very useful. Click on the Tooltip tile for each of your Marks Cards and delete the unnecessary text, leaving only the information you want your users to see (like Product Category and Sales).
Adjust Sizing: Go back and play with the Size sliders on both Marks Cards to get the perfect thickness for your donut ring. A slightly larger pie chart and a slightly smaller circle will create a thinner, more modern-looking ring.
Final Thoughts
Creating a donut chart in Tableau is a perfect example of the tool's flexibility. While it requires a few extra steps and a clever workaround using a dual-axis chart, the process allows you to build a highly effective and visually appealing element for any dashboard. By placing a key metric at the center, you provide instant context that a standard pie chart just can't match.
Of course, spending time on workarounds like this highlights how most business intelligence tools still have a significant learning curve. You need to know the specific tricks to get the job done. At Graphed, we believe you shouldn't need to learn a complex tool just to ask a simple question of your data. We designed our AI data analyst to handle this for you. Instead of a 6-step manual process, you can simply type, "Show me a donut chart of sales by product category," and we instantly create a fully interactive, real-time visualization for you. If you're ready to spend less time building charts and more time acting on insights, you can start asking questions of your own data for free with Graphed.