How-To: Build a Trellis of Donut Charts in Tableau

by Cecily Santiago

A trellis chart is a grid where each cell in the grid is the same chart type with the same x- and y-axes but filtered to a different value for some dimension. These can be a useful way to view and compare many values at once.

In this tutorial, we will build a grid where each cell is a donut chart of sales per region with each cell showing sales in a different sub-category.

Read on to build your trellis of donut charts and find links to further reading to build a other common chart types!

image created by bing ai

Here's a step-by-step guide using Tableau's built-in Superstore data with screenshots of each step.

Build a Trellis of Donut Charts

  1. Set up your trellis.

If you haven't done this already, read my blog: How-To: Set Up a Trellis Chart in Tableau.

  1. Set your "Marks" to "Pie"
Set your marks type to "Pie"
  1. Drag a [Secondary Dimension] onto "Color" on the Marks Card.

This is the dimension you want as the segments of the donut. We will use "Region" as our secondary dimension throughout this tutorial.

  1. Drag a [Measure] onto the "Angle" on the Marks Card.

This determines the size of each segment on the donut. We will use "Sales" as our measure throughout this tutorial.

At this point, you should have a trellis of pie charts.

With "SUM(Sales) on "Angle" and "Region" on "Color," you have a trellis of pie charts.
  1. Create the donut holes: Double click the "Columns" shelf and type "avg(0)" to create a pill. Do this twice.

You will now have two copies of your pies. The second copy will become the donut hole.

With "avg(0)" on "Columns" twice, we have all our pies twice.
  1. Format the donut holes:
    1. Click the second instance of "AGG(avg(0))" in the Marks Card.
    2. Change the Marks type to "Circle"
    3. Remove the pills for your [Secondary Dimension] and [Measure] from this Marks Card.
    4. Click on "Color" and change the color to white.
    5. Click on "Size" and decrease the size by about 20%.
Select the second Marks Card.
Set the Marks type to "Circle."
Set the color to white.
Decrease the size.
Your second set of pie charts have been turned into white circles.
  1. Put the holes in the donuts: right click on second "AGG(avg(0))" pill on the "Columns" shelf and select "Dual Axis."
Create a dual axis.
You should now have a trellis of donuts.
  1. Format your trellis of donuts.
    1. Right click on your viz and select "Format...." The "Format" pane will open on the left hand side, where your "Data" pane usually is.
    2. Click on the "Lines" icon to open "Format Lines," and make sure you're on the "Sheet" tab. Set the dropdowns for "Grid Lines:" and "Zero Lines:" to "None."
    3. Click on the "Borders" icon to open "Format Borders" and make sure you're on the "Sheet" tab. Under "Row Divider," set "Pane:" to "None." Do the same for "Column Divider." You can now close the "Format" pane with the "x" in the upper right hand corner.
    4. Hide the "avg(0)" headers: Either right click on the headers themselves (above/below your donuts) or right click on the "AGG(avg(0))" pills on the "Columns" shelf. In either case, uncheck "Show Header."
    5. (Optional) Add labels to your donuts:
      1. Click onto your second instance of "AGG(avg(0))" in the Marks Card. This is the one with Marks type set to "Circle."
      2. Duplicate your [Breakdown Dimension] pill and drag it onto "Label."
      3. Click "Label" and set "Alignment" to "Middle Center."
    6. Add any other desired formatting.
Right click on your viz and select "Format...."
Click on the "Lines" icon to open "Format Lines," and make sure you're on the "Sheet" tab.
Set the dropdowns for "Grid Lines:" and "Zero Lines:" to "None."
Click on the "Borders" icon to open "Format Borders" and make sure you're on the "Sheet" tab.
Under "Row Divider," set "Pane:" to "None." Do the same for "Column Divider."
You can now close the "Format" pane with the "x" in the upper right hand corner.
One way you can hide the headers is to right click on the headers themselves. Uncheck "Show Header."
Alternately, you can right click on the pills and uncheck "Show Header."
Click onto your second instance of "AGG(avg(0))" in the Marks Card. Duplicate your [Breakdown Dimension] pill and drag it onto "Label."
Click "Label" and set "Alignment" to "Middle Center."
You should see a trellis of donut charts labelled for each [Breakdown Dimension].

Voila! You've created a trellis of donut charts!

Add other chart types to your trellis using my How-Tos:

See all these charts in action with embedded How-To blogs here:

How To Build a Trellis Chart Dashboard