Creating a bubble chart
Bubble charts present data using circles of different sizes and colors. The sizes and colors of circles, or bubbles, vary based on the values they represent. A larger and/or darker circle often represents items or categories with higher values.
In this recipe, we will create a bubble chart that shows the countries with the highest populations in 2015.
Getting ready
To follow this recipe, open B05527_01 – STARTER.twbx
. Use the worksheet called Bubble
, and connect to the Data (Modified Gapminder Population)
data source.
How to do it...
The following are the steps to create a bubble chart:
- Change the mark type to Circle in the Marks card.
- From Dimensions, drag Year to the Filter shelf. This will open a new window for the filtering options.
- Under the General tab, while Select from list radio button option is selected, type in 2015 in the search text box to find this value from the list of years, and check it.
- From Measures, drag Population to Size in the Marks card.
- From Dimensions, drag Region to Color in the Marks card.
- From Dimensions, drag Country to Label in the Marks card.
- From Measures, drag Population to Label in the Marks card.
- Right-click on the SUM(Population) pill in the Label card, and select Format. This will open a format pane that temporarily replaces your data side bar.
- In the Format side pane, under the Pane tab in Defaults section, choose Number (Custom) with 1 decimal place, and Millions (M) as unit.
- Right-click on the Country pill in the Label card and select Sort.
- Choose an Ascending sort order by Sum of Population.
- Click on Label in the Marks card, and select the ellipsis button under Label Appearance to modify the style of the text.
- Adjust the label so
Country
is shown with a larger font, and population appears underneath it with a smaller font. - Click on the drop-down arrow beside the color legend again. This time choose Edit colors….
- Choose the Color Blind 10 palette.
How it works...
A bubble chart typically shows information in circles of varying colors and sizes. Creating a bubble chart in Tableau requires changing the mark type to Circle. A measure is typically placed in Size, as well as another dimension in either Color, Label, or Detail (or any combination thereof).
In this recipe, we placed the Population measure onto Size, created different bubbles for every country by placing Country in Label, and color the circles by Region.
There's more...
If the pie chart gets a bad reputation, bubbles charts do too (maybe more). If we humans cannot compare angles with ease, we are also generally not very good at comparing diameter and circumference. Is that circle 15% bigger than the previous circle?
Most would argue that bar charts would be more effective than bubble charts, and I mostly agree. However, as with the pie chart, I think bubble charts can be effective—depending on the intent and audience.
In my courses, I ask students to present their work to the rest of the class. The goals of the presentation are to present their findings, as well as to engage the audience. One of the charts that frequently captures the attention of the audience is the bubble chart. Sometimes this chart also garners the most questions—therefore more engagement.
I would also argue that typically a single chart is not a be-all and end-all—typically we complement this with other charts, dashboards, and storytelling. There is nothing that stops us from starting our story with a bubble chart to get the audience's initial attention, and once we have their attention, proceed to more details using dependable bar and line charts.
The storytelling piece is also key. We have to be effective storytellers—our charts are simply our props. With effective storytelling, any chart can be effective and exciting.
Note
If you haven't seen Hans Rosling's TED talk on The best stats you've ever seen yet, you are missing out. He is using bubbles that move—aka dancing bubbles!
https://www.ted.com/talks/hans_rosling_shows_the_best_stats_you_ve_ever_seen?language=en
However, it's not the chart that makes the presentation, it's the storyteller that makes this presentation impactful and unforgettable.
See also
- Please refer to the Creating a pie chart recipe in this chapter