pbPassingBI
/
Visualisation & export beginner 6 min

Choosing a chart type

Line, bar, histogram and scatter — which question each one answers.

What you'll be able to do
  • Match a chart type to a question
  • Build each of the four core charts
  • Know when a pie chart is the wrong answer

The mapping

QuestionChart
How has this changed over time?Line
How do these categories compare?Bar
How is this value distributed?Histogram
Are these two measures related?Scatter
What share of the whole?Stacked bar — rarely pie

Line — trend over time

fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(monthly['month'], monthly['revenue'], marker='o')
ax.set_title('Revenue by month')

Use a line only when the x-axis is genuinely continuous — time, or an ordered numeric scale. A line between unordered categories implies a progression that does not exist.

Bar — comparing categories

fig, ax = plt.subplots(figsize=(8, 5))
region_totals = df.groupby('region')['revenue'].sum().sort_values()
ax.barh(region_totals.index, region_totals.values)
Two things that make bar charts better

Sort by value rather than alphabetically — the ranking is usually the point. And use horizontal bars when category names are long, so labels stay readable.

Start bar charts at zero

Bar length encodes value. Truncating the axis exaggerates small differences into large ones, which is misleading whether or not you meant it to be. Line charts may be truncated; bars may not.

Histogram — distribution

ax.hist(df['revenue'], bins=30, edgecolor='white')

Bin count matters more than people expect. Too few hides the shape, too many turns it into noise. Try several before settling — 20 to 50 is a reasonable starting range.

Scatter — relationship

ax.scatter(df['spend'], df['revenue'], alpha=0.5)

alpha matters on any real dataset — without transparency, overlapping points hide density and a thousand points look much like a hundred.

Pie charts

People compare angles poorly. Anything beyond two or three slices is read more accurately as a sorted bar chart. Use a pie only when there are very few categories and the shares are obviously different.

Key points
  • Sort bar charts by value, and use horizontal bars for long labels
  • Bar charts must start at zero; line charts need not
  • Use alpha on scatter plots so overlapping points show density
Check yourself