Choosing the Right Chart
Question-driven chart grammar
The chart is the answer to the question: trends line/dot, comparisons bar/column, distribution hist/box, relationship scatter, part-whole stacked/bar. Match question to chart before aesthetics.
What you will learn
- Map the 5 question types to chart families
- Swap between bar/line/box/scatter for the right grain
- Avoid the pie/area traps for the wrong questions
What is this?
Chart choice follows the analytical question, not the fashion: trend over time → line; compare categories → sorted bars; distribution → histogram/box/violin; relationship between numbers → scatter + trend; part of a whole → stacked bar or a single well-communicated proportion. Naming the question forces the fitting chart.
Why do you need it?
- The wrong chart type hides even true insight.
- Knowing the five families lets you answer any stakeholder question instantly.
- Consistent chart grammar makes reports read like one author.
- Pre-commited chart types (pie whenever) silently damage credibility.
Mental model
Choosing the tool for each trade in a workshop
Chart selection
You don't use a hammer on a screw — and a line chart won't compare categories nor a pie show a trend. The needle, wrench, and calipers each measure a different thing; charts are the same set of trades.
How it works
- Trend: line (many points) or column (few time buckets).
- Comparison: sorted bar/column; dot plots for small labels.
- Distribution: histogram, KDE, box, violin.
- Relationship: scatter ± trend, hexbin for dense clouds.
- Part-of-whole: stacked bar; single proportion as one labeled slice.
- Prefer small multiples when a third dimension splits every chart.
Question → chart family.
Examples
The shape-matching one-liner
import pandas as pdq = { "revenue over 12 months": "line with markers", "plan revenue comparison": "sorted horizontal bars", "spend distribution": "histogram or box", "spend vs tenure link": "scatter + trend", "share of each plan": "stacked bar or one labeled slice",}print(q)Mapping questions to families first makes every chart a deliberate choice, not a reflex.
In production
- A board KPI pack enforces 'trend → line, rank → bar' so every page reads instantly.
- A support review picks box plots over means for queue-time comparisons by team.
- A pricing study uses small-multiple scatters for price × demand × segment.
Best practices
- Write the question as a comment before the charting code.
- Prefer horizontal bars for long labels; vertical for time.
- Add trend lines to scatters for direction; keep raw points visible.
- When in doubt, sorted bar — it's auditable and honest.
Common mistakes
- Line charting categorical IDs — the x-axis invents a fake sequence.
- Pie charts for a 15-slice product mix.
- Area charts implying volume where only share exists.
- Box plots to show trends (losing the chronology — use a ribbon/sparkline instead).
Debugging tips
- A 'trend' chart that drifts oddly → check the x-axis is truly chronological.
- Bars too similar to compare → labels direct or dot plot.
- A scatter that reads as stripes → bin or jitter to expose density.
- If a chart needs a paragraph to explain, the type is wrong.
Interview checkpoint
Hands-on lab
- Classify questions into the five families
- Produce one fitting chart per family
- Justify each choice in one line
Match Five Questions to Five Charts
25 min · beginner
Quick quiz
Best chart for spend vs tenure relationship:
A line chart is fine for comparing nominal categories.