How to create a Plum Pudding Chart in Tableau

A plum pudding is a traditional British dessert usually served on Christmas dinner. It's a dome shaped cake-like sweet desert with fruit pieces on the inside. In the early 1900 the plum pudding made its way into science when it was proposed as a model for the atom. This scientific model is now obsolete, but the plum pudding is being used in data analytics to show progress towards a goal or the proportion of the total.

This creative chart type is based on the idea of a waffle chart, but instead of having a square to represent the proportions, the plum pudding chart plots a number of coordinates in a circular shape and identifies either random coordinates to showcase the proportion or you can fill the chart from the top or the bottom to show the progress.

You can create plum pudding charts using Table Calculations or you can create it by using Level of Detail (LOD) expressions. For this blog, we will focus on creating it using LODs.

The data source for this demonstration is from week 27 of the Makeover Monday challenge. This data set includes historical information about the natural gas production of countries from 1900 - 2022.

https://visualizingenergy.org/the-history-of-global-natural-gas-production/

The measure for the gas being produced is called an Exajoule, which most people might not have heard of before. Instead of keeping the measure in Exajoules, the values will be converted to the equivalent number of barrels of oil which will be easier to represent in the chosen chart type. Based on information on a website called Resilience (a program of the nonprofit organization Post Carbon Institute): 1 Exajoule = 174 million barrels of oil.

Before you can create the chart in Tableau you need to create an Excel sheet with the X and Y coordinate values that will place your data points in a circular shape. Instead of trying to figure out what these coordinates should be through some complex mathematical calculations, you can use this website:

http://hydra.nat.uni-magdeburg.de/packing/cci/cci100.html

Since the plum pudding chart in this case is being used to represent the percentage of natural gas a specific country produced within a selected year, it makes sense to get 100 points so that the percentage is converted to a number out of 100. Each pair of coordinate has an ID and it's important to include that ID number when the information is copied into and Excel sheet.

Bring the data sources into Tableau by connecting to the main data source first (in this case the natural gas production file), and then add the Excel sheet with the coordinates. Create a left join with the data sources using a calculated field where 1 = 1. This will create a one-to-one relationship between the natural gas production records and the coordinates.

It is important to note that this method will blow up your data records so that each row in the natural gas production which represents a country in a given year, is connected to all the coordinates in the Excel sheet. This means each row of the natural gas production will be duplicated 100 times.

The next step is to create the calculated fields.

The first calculation is to convert the gas production value which is exajoules to barrels of oil by multiplying it with 174 million. Since there are 100 duplicate rows for each country, this value should be divided by 100 to represent the correct amount.

The first level of detail expression will calculate the yearly total barrels of oil per country and the reason it needs to be an LOD is so that when the information is split into the 100 data points for plotting, the total needs to stay constant and not be divided by 100 again. The LOD is fixed on the Country and Year fields and calculates the sum of the barrels of oil.

The next LOD expression will calculate the total barrels of oil per year for all the countries that produced natural gas. The LOD is only fixed on the Year field and calculates the sum of the barrels of oil.

The next step is to calculate the percentage of barrels that each country produced within a given year by dividing the country yearly total by the overall yearly total. This percentage value is what will be used to determine how many data points will be selected to present the proportion in the plum pudding chart.

To convert the percentage to a number out of 100 it won’t work to just round up the percentage value. The CEILING() function is used instead which will round up to the next integer number. This is done to ensure the plum pudding chart represents the smallest percentage as a 1 instead of a 0.

The ID numbers that came with the coordinates will be used to pick which data points to highlight in the plum chart to show what proportion of the whole the selected country makes up. To put it in basic terms: we have IDs from 1-100. If the Plum Chart Number is greater than or equal to the ID number, then highlight that data point. If the Plum Chart Number is less than the ID number, then don't highlight that point.

To test it out, set up a sheet as shown below to look at one country in one year. Display the ID numbers, your Plum Chart Number, and the Colour expression. The Colour field should be True for all values where the Plum Chart Number is Greater than the ID numbers. You'll notice in the example below; the Plum Chart Number is 25 (meaning 25 of the 100 points need to be highlighted to show that 24% of the natural gas that was produced by the United States). All IDs that are less than or equal to the ID number says True, once you hit 26 and on, it says False.

With the calculations configured, the sheet can be set up to create the plum pudding chart. Drag the X field to the 'Columns' tab and the Y field to the 'Rows' tab to populate the coordinates for the plum chart.

Drag the LOD_Colour field onto the marks card and place it on the shape tab. Add oil barrel icons to your Tableau Repository under the Shapes folder to make sure it populates in Tableau as custom shapes.

The 'False' results for the LOD_Colour expression will be represented by an empty barrel of oil (white) and the 'True' results will be represented by a full barrel of oil (black), as shown below.

The screen should now look something like the image below. At this point all the countries and all the years are included, which is why all the barrels of oil are filled (because 100% of the data points are true). Create a filter to only show one country in one year, by using one of two options: drop the Country and Year field onto the Filters tab and select the country and year or create a parameter for the Country and Year field and create calculations to incorporate the parameters in the sheet.

Since the usual filters allows for an 'All' option, the image below is filtered using parameters so that the user cannot show all the years and countries at the same time. Filter to a selected country and a selected year so that the correct proportions can be displayed. The image below is filtered to the United States natural gas production in 2020.

Now that the sheet is set up, play around with the filters to see how it affects the chart. For an example of how this chart was used in a dashboard, head over to Tableau Public and see it here:

https://public.tableau.com/app/profile/lorrainef/viz/MOMWeek27/MOM2024Week27#1

Author:
Lorraine Ferrusi
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab