Toan Hoang

Double, Spaced Doughnut Chart Tutorial

After the United Kingdom 2017 General Election, on Thursday 8th June 2017, I had many conservations about our First Past The Post system (FPTP), and why we do not have a Proportional Representation (PR). In the UK FPTP system, we have 650 individual battlegrounds, each representing one seat, the party with the most seats wins. This means that a party could technically score second place in every battle but have zero seats in Parliament.

In this tutorial, we will walk through the creation of Double-Spaces Doughnut charts in Tableau.

Disclaimer: This tutorial goes through several techniques which will hopefully help you in your journey. However, and as always, try to find the most appropriate visualisation for specific data visualisation and dashboard requirements.

Data

We will start by loading the following data into Tableau.

PartyValuesTypePathPosition
Conservatives0.489Percentage of Seats11.3
Conservatives0.489Percentage of Seats3601.3
Conservatives0.489Percentage of Seats11.5
Conservatives0.489Percentage of Seats3601.5
Conservatives0.424Percentage of Votes11
Conservatives0.424Percentage of Votes3601
Conservatives0.424Percentage of Votes11.2
Conservatives0.424Percentage of Votes3601.2
Labour0.403Percentage of Seats11.3
Labour0.403Percentage of Seats3601.3
Labour0.403Percentage of Seats11.5
Labour0.403Percentage of Seats3601.5
Labour0.400Percentage of Votes11
Labour0.400Percentage of Votes3601
Labour0.400Percentage of Votes11.2
Labour0.400Percentage of Votes3601.2
Liberal Democrats0.018Percentage of Seats11.3
Liberal Democrats0.018Percentage of Seats3601.3
Liberal Democrats0.018Percentage of Seats11.5
Liberal Democrats0.018Percentage of Seats3601.5
Liberal Democrats0.074Percentage of Votes11
Liberal Democrats0.074Percentage of Votes3601
Liberal Democrats0.074Percentage of Votes11.2
Liberal Democrats0.074Percentage of Votes3601.2

Note: We have two records per segment as we are going to use data densification to give us additional points for drawing.

Calculated Fields

With our data set loaded into Tableau, we are going to create the following Calculated Fields and Bins:

Path (bin)

Zero

0

Index

INDEX()

Seat Share

MAX(IF([Type]="Percentage of Seats") THEN [Values] END)

Vote Share

MAX(IF([Type]="Percentage of Votes") THEN [Values] END)

TC_Position

WINDOW_MAX(MAX([Position]))

TC_Values

WINDOW_MAX(MAX([Values]))

X

SIN([Index]*2*PI()/180)*[TC_Position]

Note: We need to convert percentages to Radians by multiplying by PI() and then dividing by 180.

Y

COS([Index]*2*PI()/180)*[TC_Position]

Color

IF [Index]*2/360 <= [TC_Values] THEN WINDOW_MAX(MAX([Party])) ELSE "Gray" END

So now that we have created a lot of Calculated fields, we will now put this together into a Worksheet.

Worksheet

We will now build our worksheet by:

After this you should have the following:

We will now complete the visualisation by adding the central text.

We should now see the following:

You have now built a worksheet that shows a Double-Spaced Doughnut Chart where the inner circle represents the number of votes and the outer circle represents the number of seats.

Adjusting the Visual

We will now do the following to get the look that we require:

You want to end up with the following:

and boom, you are done…

Summary

I hope you all enjoyed this article as much as I enjoyed writing it. Do let me know if you experienced any issues recreating this Visualisation, and as always, please leave a comment below or reach out to me on Twitter @Tableau_Magic.

If you like our work, do consider supporting us on Patreon, and for supporting us, we will give you early access to tutorials, exclusive videos, as well as access to current and future courses on Udemy:

Also, do be sure to check out our various courses:

Exit mobile version