Reader small image

You're reading from  Tableau 10 Business Intelligence Cookbook

Product typeBook
Published inNov 2016
PublisherPackt
ISBN-139781786465634
Edition1st Edition
Tools
Right arrow
Authors (2):
Donabel Santos
Donabel Santos
author image
Donabel Santos

Donabel Santos is a self-confessed data geek. She loves working with data, writing queries, and developing reports on her SQL Server databases, and exploring and visualizing data with Tableau. She is the principal and senior business intelligence architect at QueryWorks Solutions, a Tableau Learning and Alliance partner in Vancouver, BC, Canada, providing consulting and training services. She has spent years in consulting and has developed a variety of solutions for clients in different verticals—finance, manufacturing, healthcare, legal, higher education, and local government. Donabel is a multi-year Microsoft Data Platform MVP (previously known as SQL Server MVP) and has extensive experience in the SQL server in different areas, such as development, administration, data warehouse, reporting (SSRS), tuning, troubleshooting, XML, CLR, and integration with ERPs and CRMs using PowerShell, C#, SSIS, and Power BI. One of Donabel's passions is teaching and sharing her love for data. She is a Tableau Certified Professional and a Tableau accredited trainer, delivering Tableau public and on-site client training. She is also the lead instructor for a number of courses at British Columbia Institute of Technology (BCIT), including Applied Database Administration and Design (ADAD) and Applied Data Analytics (ADA) programs. She teaches SQL server administration, development, integration (SSIS), data warehouse foundations, and visual analytics with Tableau. Donabel has also authored three other books with Packt Publishing: SQL Server 2012 with PowerShell V3 Cookbook, PowerShell for SQL Server Essentials, and SQL Server 2014 with PowerShell V5 Cookbook. She also contributed a chapter to Manning Publications' PowerShell Deep Dives.
Read more about Donabel Santos

Paul Banoub
Paul Banoub
author image
Paul Banoub

Contacted on: 18/12/2015 for Mastering Tableau 10 [video]
Read more about Paul Banoub

View More author details
Right arrow

Creating a pie chart


A pie chart is a circle—or pie—that is sliced. Each slice is identified using a different color and/or label. The size or angle of the slice represents that item or category's proportion to the whole. Pie charts are best at showing part-to-whole relationships when there aren't too many slices. Bar charts are great and popular alternatives to pie charts.

In this recipe, we will create a pie chart that shows the top five endorsements in 2014, sliced by sport.

Getting ready

To follow this recipe, open B05527_01 – STARTER.twbx. Use the worksheet called Pie, and connect to the Top Athlete Salaries (Global Sport Finances) data source.

How to do it...

The following are the steps to create a pie chart:

  1. Change the mark type to Pie in the Marks card.

  2. From Measures, drag Endorsements $ to Angle in the Marks card.

  3. From Dimensions, drag Sport to Color in the Marks card.

  4. Right-click on Sport pill in the Color property in the Marks card and select Filter….

  5. In the Top tab, select By field: Top and 5 by Sum of Endorsement $.

  6. Right-click on Sport pill in the Color in the Marks card and select Sort.

  7. Filter Ascending by Sum of Endorsement $.

  8. From Measures, drag Endorsements $ to Label in the Marks card.

  9. Right-click on SUM(Endorsements $) pill in the Label property in the Marks card. Select Quick table calculation, and then Percent of total.

  10. From Measures, drag Endorsements $ again to the Label in the Marks card.

  11. Click on Label in the Marks card, and select the ellipsis button under Label Appearance to modify the style of the text.

  12. Change the format of the label to show the following, and click OK when done.

How it works...

Tableau comes with a built-in mark called Pie. When you switch the mark to a Pie, a new property appears under the Marks card called Angle.

To create a pie chart, simply change the mark to a Pie. Drag a measure to Angle, and a discrete field to Color.

Often a pie chart is accompanied by a label containing what the pie is, and what percentage of the pie that slice is. Percent of Total is a readily available Quick Table Calculation.

To add this as a label, you need to add a measure to the Label in Marks card first. This will initially display the actual values of that measure. Once added, you can right-click on this measure and select Quick Table Calculation. This should expand the readily available quick table calculations, which would include Percent of Total.

There's more...

Pie charts often get a bad reputation in the visual analytics world. One reason is because humans can't naturally compare angles (or pie slices) easily, especially if the pie slices are pretty close in size. Bar charts are often more effective in showing the difference in magnitudes, because all we need to look at are the edges.

Note

If you are interested, you can check out the world's most accurate pie chart. Word of warning however, you have to have humor to continue (credit to Damien Foley's blog site): http://bit.ly/accuratepiechart.

I think part of the issue is also abuse. Sometimes there is a tendency to overuse pie charts in presentations—especially the 3D tilted, exploded ones. Comparing angles is hard enough, tilting and exploding the pies do not help clarify the numbers.

Note

Word of wisdom: the slices of the pie in a pie chart must sum up to 100%. Wisdom is learning from other's mistakes http://bit.ly/best-pie-chart-ever.

However, pie charts can be effective in showing what proportion of the whole is allocated to something. I think pie charts have their place in the visual analytics and reporting world. Just like any other tools in your toolset, we just need to use them in the right place, right time.

See also

  • Please refer to the Creating a tree map recipe in this chapter

Previous PageNext Page
You have been reading a chapter from
Tableau 10 Business Intelligence Cookbook
Published in: Nov 2016Publisher: PacktISBN-13: 9781786465634
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Donabel Santos

Donabel Santos is a self-confessed data geek. She loves working with data, writing queries, and developing reports on her SQL Server databases, and exploring and visualizing data with Tableau. She is the principal and senior business intelligence architect at QueryWorks Solutions, a Tableau Learning and Alliance partner in Vancouver, BC, Canada, providing consulting and training services. She has spent years in consulting and has developed a variety of solutions for clients in different verticals—finance, manufacturing, healthcare, legal, higher education, and local government. Donabel is a multi-year Microsoft Data Platform MVP (previously known as SQL Server MVP) and has extensive experience in the SQL server in different areas, such as development, administration, data warehouse, reporting (SSRS), tuning, troubleshooting, XML, CLR, and integration with ERPs and CRMs using PowerShell, C#, SSIS, and Power BI. One of Donabel's passions is teaching and sharing her love for data. She is a Tableau Certified Professional and a Tableau accredited trainer, delivering Tableau public and on-site client training. She is also the lead instructor for a number of courses at British Columbia Institute of Technology (BCIT), including Applied Database Administration and Design (ADAD) and Applied Data Analytics (ADA) programs. She teaches SQL server administration, development, integration (SSIS), data warehouse foundations, and visual analytics with Tableau. Donabel has also authored three other books with Packt Publishing: SQL Server 2012 with PowerShell V3 Cookbook, PowerShell for SQL Server Essentials, and SQL Server 2014 with PowerShell V5 Cookbook. She also contributed a chapter to Manning Publications' PowerShell Deep Dives.
Read more about Donabel Santos

author image
Paul Banoub

Contacted on: 18/12/2015 for Mastering Tableau 10 [video]
Read more about Paul Banoub