BI & Analytics
Blog
Tableau
8
min read

How to label pie charts in Tableau

Learn more on how to label pie charts in Tableau like a pro.
Author
Donna Coles
Donna Coles
Analytics Engineer
How to label pie charts in Tableau
Share article

Learn how to label pie charts in Tableau like a pro

Want to learn more about labeling your pie charts in Tableau? Don't worry. This blog aims to provide you with in-depth step-by-step instructions on how to label pie charts in Tableau like a pro.

Let's get started!

Labeling pie charts in Tableau

When building a pie chart in Tableau, the default behaviour when choosing to show mark labels is for the label to be displayed outside of the pie.

default option to display labels on a pie chart in Tableau

Additional fields can be added to the Label shelf if required, for example if you don’t want to display a separate colour legend, you’d typically add the field the data is split by onto the label instead.

add field to label shelf to display it on a pie chart in Tableau

Or you may choose to combine to display additional information.

add multiple fields to the label shelf to display them on a pie chart in Tableau

Tableau will position the label based on where it computes ‘is best’ given the number and the size of the different slices and how the slices are sorted.

For example, the pie chart below has been split by Ship Mode which has 4 values. The image on the left is sorted based on the default sort order (alphabetical), whilst the one on the right is sorted based on the volume of sales.

comparing the different positions of a label on a pie chart in Tableau based on how the data is sorted

Manually repositioning labels

As with all labels, it is possible to manually move them; just click on the text of the label you want to move, and when the cursor changes to a cross, you can drag the label to reposition it.

manually move the label on a pie chart in Tableau to a new position

However, you should only do this if the data you are presenting is static and won’t change (unless you are changing the workbook too, and can review how the data is displayed), and the data can’t be interacted with by the user.

For example, the image below shows a pie chart with the labels positioned where Tableau put them. The left image shows the data split into 4 ship modes. The right image has been filtered to exclude the Standard Class option. The labels are all positioned in a sensible location.

comparing the position of labels on a pie chart when data is filtered in Tableau

In the left hand image below, the label for Second Class has been manually moved to be positioned slightly higher than it was. Excluding the Standard Class option, now displays the label for Second Class in an unexpected position.

comparing the position of labels on a pie chart that have been manually repositioned when data is filtered in Tableau

Displaying pie chart labels with line pointers

using line pointers to display labels on a pie chart in Tableau

In order to display labels on your pie chart with pointers or arrows, you will need to use annotations.

Right click on a section of the pie chart and select Annotate > Mark Label

use annotate mark function to add labels with pointers to a pie chart in Tableau 

An Edit Annotation dialog box will display. By default it will contain information relating to all the fields on the current canvas of the worksheet - in this instance Segment and Sales.

If you want to label with something else, add the field onto the Detail shelf, and it can then be referenced in the dialog box. Adjust the text of the annotation as required.

Click on the annotation and manually move it to your desired position. Readjust the alignment of the text if required. Then right click on the annotation to format. In this instance the background shading has been reduced to 0%, and the line pointer has been made darker and thicker.

Adjust the size of the annotation box as required.

customise the annotation on a pie chart in Tableau

You then need to repeat this process for each of the sections on the pie chart you want to label.

Unfortunately, since this involves manually moving the annotations into a preferred position, the same issues can arise as discussed in the manually repositioning labels section above, so this isn’t a recommended solution if working with data that can change or be interacted with by the user.

Labelling inside a pie chart

positioning labels inside a pie chart in Tableau

You can create the appearance of labels inside a pie chart by using a dual axis technique.

Having built your basic pie chart, double click into the Rows and type MIN(0) to generate an axis.



creating an axis for a pie chart using MIN(0) in Tableau

Double click into Rows again, and type another instance of MIN(0). You’ll now have two pie charts and two axes. Add the fields you want to use as labels to the Label shelf of the second MIN(0) marks card, and if they don’t automatically display, check the show mark labels option on the label shelf.



positioning labels on a dual axis pie chart in Tableau

Make the chart dual axis and synchronise the axis. Remove Measure Names from the All Marks card, as it automatically gets added at the point we made the dual axis.

Then adjust the Size of the first MIN(0) marks card, so the pie chart without the labels is bigger. You may need to adjust the size of the labelled pie chart too.

(Note, if your pie charts aren’t sizing independently, make sure you don’t have any fields on the Size shelf - by default if you use the show me function to make a pie chart, it will add the measure eg Sales, to both the angle and the size property of the chart).

a dual axis pie chart used to display labels inside the pie chart in Tableau

Finally remove all gridlines, zero lines, row & column dividers, and hide the axis (uncheck show header).

The issue with this technique is that the segments for the inner pie chart still show on hover or on click.

the sections of the inner pie chart are still visible with a dual axis pie chart in Tableau

But there is another way to do this, which means this doesn’t happen.

Labelling the inside of a pie chart with map layers

positioning labels inside a pie chart using map layers

On the face of it, the pie itself doesn’t look any different from the dual axis method, but if you do have Tableau v2020.4 or greater, and you are building an interactive dashboard that allows users to hover and click on objects on the dashboard, then using map layers is probably the ‘cleaner’ solution.


Building the first map layer

In order to use map layers, you must use a field with a geographic data type. As we’re not using one in this chart, we need to make one.

Create a new calculated field

Zero

MAKEPOINT(0,0)

Double click this field, and it will automatically add the point centrally onto a map with Longitude and Latitude fields automatically generated too.

adding MAKEPOINT(0,0) to the canvas in Tableau places a single point in the middle of a map of the world

Add the field you want to ‘slice’ your pie with (in this case Segment) to Colour and adjust the colours. Change the mark type to pie chart and add your measure (in this case Sales) to angle. Increase the size to be as large as possible.



creating a single pie chart on a map in Tableau

To increase the size beyond that possible with the slider on the Size shelf, use Ctrl-Shift-B (Windows) or Cmd-Shift-B (Mac) to increase the size further (Ctrl-B / Cmd-B to reduce).



using keyboard shortcuts to increase the size of a pie chart on a map in Tableau

Building the second map layer

Drag Zero onto the map canvas and drop it over the Add a Marks Layer section that displays. This will add a second marks card called Zero(2)

adding a marks layer to a map in Tableau

Rename the marks card labelled Zero to Pie Chart, and rename the marks card called Zero(2) to Label as this will make it easier to manage the layers (and these instructions).

Change the mark type of the Label marks card to pie chart. Add the same measure you used in the initial pie chart (ie Sales) to the angle shelf. Add the fields you want to use as a label to the Label shelf.

labelling the second map layer of a pie chart in Tableau

Adjust the size of the labelled pie chart to shift the labels so they are positioned as best as they can within the relevant slice of the outer pie.

Then prevent the inner circle / pie from being selected by clicking on the context menu next to the Label marks card name, and selecting disable selection.

disable selection of a map layer in Tableau

If you click on the inner circle, it will now select the relevant area of the outer pie.  

Then reduce the opacity of the Label pie chart to 0%, and the inner circle will disappear.

labelling the inside of a pie chart with map layers

Finally remove the background map (from the Map menu, select Background Maps > None). This will result in the chart being displayed with traditional axes.

removing background map from map in Tableau displays traditional axes

To finish, remove all gridlines, zero lines and axis rulers and hide the axes headers.

Extending the concepts

Once you’ve understood the different methods, you can then combine them to enhance how your visualisations are displayed.

In the image below, map layers have been used. The first map layer (the main pie chart) is labelled using the default labelling functionality. A second map layer is added which uses a circle mark type, which has been labelled with the text ‘Segment Sales’.

positioning a chart title in the centre of a pie chart in Tableau

In this next example, map layers are again being used. The first map layer (the outer pie chart) is labelled with the segment name using the default labelling, while the second map layer (the inner pie chart) is labelled with the value.

position labels both inside and outside of a pie chart in Tableau

Summary

Hopefully this blog has given you some ideas as to how you can position labels on a pie chart in different ways. However there is no foolproof way to get labels perfectly positioned without manual intervention, and doing that can add more issues as discussed above.

A workbook to accompany this blog post which features the examples discussed above, is accessible here.

Facts & figures

About client

Testimonial

Blogs you might also like

5 Ways to Level Up Your Bar Chart Using Tableau Parameter Actions

5 Ways to Level Up Your Bar Chart Using Tableau Parameter Actions

Tableau Parameter Actions are a great feature in Tableau. Read all about it in our latest blog.

BI & Analytics
Blog
Tableau
Everything you need to know about Tableau Certifications

Everything you need to know about Tableau Certifications

Thinking of taking one of the Tableau Certifications? We explore how to get ready in our latest blog. Read all about it here.

BI & Analytics
Blog
Tableau
Personalise your Tableau Dashboard with Custom Titles

Personalise your Tableau Dashboard with Custom Titles

Learn about how to add the personal touch to your Tableau Dashboard with custom titles.

BI & Analytics
Blog
Tableau
Bar Charts: The Good, the Bad, and the Ugly

Bar Charts: The Good, the Bad, and the Ugly

Why can bar charts be effective and how to use them to get answers easier, and faster!

BI & Analytics
Blog
Tableau
How to create a waterfall chart in Tableau

How to create a waterfall chart in Tableau

Learn how to create your own waterfall charts in Tableau Desktop by following these steps.

BI & Analytics
Blog
Tableau
The Ultimate Guide to Embedded Analytics

The Ultimate Guide to Embedded Analytics

Discover what embedded analytics is all about and how it can drive additional revenue streams for your business.

BI & Analytics
Blog
ThoughtSpot
How to label bar charts in Tableau

How to label bar charts in Tableau

Learn how to label bar charts in Tableau like a pro and level up your dashboard design. Read the full article here.

BI & Analytics
Blog
Tableau
How to create a donut chart in Tableau

How to create a donut chart in Tableau

Looking to create a donut chart in Tableau? Read our in-depth guide on how to level up your donut charts in Tableau here.

BI & Analytics
Blog
Tableau
How to ace your ThoughtSpot certifications?

How to ace your ThoughtSpot certifications?

Learn more about ThoughtSpot certifications and how to ace your exams.

BI & Analytics
Blog
ThoughtSpot
How to stop marks being highlighted when ‘clicked’ in Tableau

How to stop marks being highlighted when ‘clicked’ in Tableau

Learn how to stop marks from being highlighted when clicked in Tableau.

BI & Analytics
Blog
Tableau
How to Create Multiple Select Parameters in Tableau

How to Create Multiple Select Parameters in Tableau

Learn how to create multiple select parameters in Tableau to add more control and interactivity to your analysis.

BI & Analytics
Blog
Tableau
How to apply conditional formatting to tooltips in Tableau

How to apply conditional formatting to tooltips in Tableau

Learn how to apply conditional formatting to tooltips in Tableau with our step-by-step guide. Improve your data visualization skills today with Biztory.

BI & Analytics
Blog
Tableau
Rediscovering Business Intelligence with Sigma Computing

Rediscovering Business Intelligence with Sigma Computing

Discover how Sigma Computing is reshaping the BI landscape with its user-friendly interface and powerful capabilities.

BI & Analytics
Blog
Sigma
Sigma Computing: Our Favourite Features

Sigma Computing: Our Favourite Features

Discover our favourite features of Sigma for powerful and fun data analysis.

BI & Analytics
Blog
Sigma
Tableau vs. Power BI: Everything to know

Tableau vs. Power BI: Everything to know

Compare Tableau and Power BI to determine the best business intelligence tool for your needs.

BI & Analytics
Blog
Tableau
Tableau Map Layers: Getting Started (1/3)

Tableau Map Layers: Getting Started (1/3)

Learn how to leverage Tableau's Map Layers feature to create complex visualizations.

BI & Analytics
Blog
Tableau
Tableau Map Layers: Pull everything into one view (3/3)

Tableau Map Layers: Pull everything into one view (3/3)

Use Tableau Map Layers to combine multiple visuals in a single worksheet and create custom dashboard views for enhanced data visualization.

BI & Analytics
Blog
Tableau
Tableau Map Layers: Building Different Charts (2/3)

Tableau Map Layers: Building Different Charts (2/3)

Learn how to create Pie, Doughnut, Line, and Area charts using Tableau Map Layers.

BI & Analytics
Blog
Tableau