Creating Unit Charts in Tableau

Alisha Dhillon
5 min readSep 20, 2022

--

Personally, I like the use of a unit chart to convey impact. I think they work really well to display a part-to-whole relationship, much better than a pie chart, especially when it comes to storytelling within a visualisation. I feel more comfortable using it in infographic visualisations rather than business-style ones.

What is a unit chart?

Unit charts allow us to communicate quantities. Whether you are representing a single point or a larger number, unit charts successfully allow you to convey impact. Where a dataset is very large, you can summarise multiple points within a single one. Whilst showing the quantity of the data points being represented can be useful, you can group values or colour certain points in relation to the greater unit chart. This will allow you to compare the grouping to your greater unit chart points.

The data is important!

You need to ensure that every row has a unique identifier such as a record ID. This identifier must be distinct and therefore, a record ID is more reliable than a first name as sometimes, multiple rows of data may correspond to the same name, despite being different people. The identifier will allow it to be a point within the unit chart. A lot of datasets come with a record ID field but if not, go and add this in. Here are two examples of my data prep.

Example 1

The Lifecycle of Plastics —Here is a single column with different entities and then a value that represents years starting from 1 and ending at the max for the entity.

Example 2

Banknotes that feature Women — This comes from a Diversity in Data dataset. You can find the data here:

This dataset only has 64 rows with several denominations listed. The information notes that the study looked at 1006 international banknotes. There are several approaches that could have been taken, in exploring the countries, the notable women and so on. It was noted that there was a distinct lack of women appearing on the notes. Therefore, by adding a ‘Number’ (RecordID) of 1 -1006, the comparison of the 64 rows against the 1006 bank notes could be made more clearly.

The build within Tableau

The build is really simple. The most important part is taking your record ID field and dragging it to drop on detail in your marks card. You will want this field to be a dimension (the blue pill), as you are using it to break your view into those points.

Example 1

The Lifecycle of Plastics

Columns = Entity

  • This will split your view to have one column for each Entity in the dataset. Entities include: Average Human Life Expectancy, Coffee Pod, Plastic Toothbrush and so on.

Detail = Years

  • This will break your view depending on the number of years per entity.

That should give you the initial view. You will notice that I changed the marks to circle in this example.

Example 2

Banknotes that feature Women

Trellis calculations were used within this to formalise the structure. Trellis calculations allow us to split things equally between rows and columns to form a grid-like set of points. These calculations can come in handy so bookmarking them or saving them somewhere is advised.

Trellis Calculations in Tableau:

Columns = (index()-1)%(round(sqrt(size())))

Rows = int( (index()-1)/(round(sqrt(size()))))

It is important to change both to discrete and compute using number (RecordID). You can also apply some formatting to hide the headers.

Detail = Number

Colouring:

Finding logical patterns and displaying part-to-whole relationships can be done very well with the use of colour. If there is a pattern or a way to distinguish points, you can group them within Tableau, and then use that grouping on colour within the marks card. Alternatively, you can add a boolean flag within the data preparation and then use that boolean within colour on the marks card.

In both examples, the record ID is used on detail to break the view.

Key considerations

  • If you have too many points, you can condense down your points by dividing by a number appropriate.
  • If you say 1 point = 10 years, for example, you must make the audience aware somewhere in your viz.
  • Use a key or colour legend where you need to.
  • You can use text as a colour legend where you are only colouring one area. Example 2 includes this within the title to make it clear from the outset.

Final outcomes

Example 1

The Lifecycle of Plastics

https://public.tableau.com/app/profile/alishadhillon/viz/TheLifecycleofPlastics/Dashboard1

Example 2

Banknotes that feature Women

https://public.tableau.com/app/profile/alishadhillon/viz/BanknotesthatfeatureWomenDiversityinData/Dashboard1

--

--

Alisha Dhillon

Business Intelligence Analyst | Ex DS21 | Tableau Public Featured Author 21 | 2x VOTD | @infolabuk @dataschooluk Alumni