The request

From Priya Shah, Head of Data
Your goal
Choose the chart that answers the question.
What Priya gets, and why
The lesson
Five questions, five charts
Pick a chart by the question it has to answer, never by how it looks. Almost every analyst question falls into one of five kinds:
| The question | The chart | matplotlib | pandas |
|---|---|---|---|
| How does something change over time? | Line | ax.plot |
kind="line" |
| How do categories compare? | Bar | ax.bar / ax.barh |
kind="bar" / "barh" |
| How are the values spread out? | Histogram | ax.hist |
kind="hist" |
| Do two numbers move together? | Scatter | ax.scatter |
kind="scatter" |
| What is a total made of? | Stacked bar (or a pie) | ax.bar(..., bottom=) |
kind="bar", stacked=True |
A quick test for the first two: does the x-axis have a natural order, like days or months? Then a line. Are they categories with no order, like channels or return reasons? Then bars.
The same data, different questions
Harbor & Pine’s order values can answer several questions, each with its own chart:
- “Did order values grow over the year?” Average value per month, as a line.
- “Which channel has the biggest baskets?” Average value per channel, as bars.
- “Are most orders small?” Every order’s value, as a histogram.
- “Do pricier products sell fewer units?” One point per product, price against units, as a scatter.
So the data alone doesn’t pick the chart. The question does.
Why pies are rarely the answer
The eye compares lengths well and angles badly. Six slices of similar size, such as the six product categories, are almost impossible to rank in a pie, while six sorted bars rank themselves. Keep pies for two or three parts of one total, like the three sales channels, and only when the exact differences don’t matter.
Common mistakes
- Drawing a line between categories that have no order: it suggests a trend that isn’t there.
- Answering a distribution question with an average. The average of 2025 completed orders is $535.90, but half of them are under $257.96; one number can’t show that.
- Using a pie for many parts, or for parts that don’t add up to one total.
- Putting two questions in one chart. If you need two answers, draw two charts.
Lantern lit!
Practised: chart choicehistogramline chartbar chartscatter
- Solved
- No hints
- First run
