Five charts, one question
A café chain's owner asks: "Which branch sold the most last month?"
A new analyst sends a pie chart with twelve thin slices. The owner cannot tell the slices apart and asks again.
The numbers were right. The chart was wrong for the question.
By the end of this lesson
Note
I can choose the right chart for a question about data.
Key words
| Word | What it means | Example |
|---|---|---|
| Bar chart | bars whose length shows a value | |
| Line chart | points joined to show change over time | |
| Pie chart | a circle cut into parts of a whole | |
| Scatter plot | dots that show how two values relate | |
| Axis | the scale along one edge of a chart | |
| Histogram | bars that count values in each band | 0 to 10 minutes |
The cells students fill in are left blank in this preview.
Start from the question
Every chart answers one kind of question. So read the question first, and pick the chart second.
If it says "which is biggest", you are comparing things: use a bar chart. If it says "how has it changed", you are looking at time: use a line chart.
The table below gives the five questions you meet most at work.
Which chart for which question
| The question asks | Use | Café example |
|---|---|---|
| Which is biggest? | Bar chart | Sales at each branch |
| How has it changed? | Line chart | Sales each month |
| What share of the whole? | Pie chart, few parts | Hot and cold drinks |
| Do two things move together? | Scatter plot | Temperature and iced drinks sold |
| How are values spread? | Histogram | Minutes each customer waited |
The cells students fill in are left blank in this preview.
A bar chart compares
In a bar chart, each bar is one thing, such as one branch. Its length is its value.
The eye compares lengths quickly, so the biggest and the smallest stand out. Put the bars in order of size when the order of the names does not matter.
The code below draws a bar chart with text, one # for every 2 coffees.
Draw a bar chart with text
# Coffees sold yesterday at each branch of a cafe chain.
branches = ["Leeds", "York", "Hull", "Bath"]
sold = [42, 30, 18, 36]
# One # for every 2 coffees, so the bars fit on the screen.
for i in range(len(branches)):
bar = "#" * (sold[i] // 2)
print(branches[i].ljust(6), bar, sold[i])
# Add a branch "Ely" that sold 24, then press Run.
A common mistake
Warning
Many people think a bar chart's axis can start at any number. It must start at zero, because a bar's length is its value. Start the axis at 40 and a branch selling 42 looks twice the size of one selling 41.