Dashboard Design Basics¶
A dashboard is not a collection of charts — it's an answer to a question. Before opening Power BI or Tableau or writing a single line of matplotlib code, you need to know what question the dashboard is answering, who is asking it, and what decision it will inform.
Learning Objectives¶
- Define the purpose and audience before designing
- Apply layout principles: hierarchy, grouping, whitespace
- Choose KPIs correctly — metrics that drive decisions
- Design dashboards that guide the eye to the insight
- Avoid the most common dashboard mistakes
The Dashboard Design Process¶
- Define the question — What decision does this dashboard support?
- Define the audience — Who reads it? What do they already know?
- Identify the KPIs — Which 3-5 metrics matter most?
- Choose chart types — One chart, one question
- Sketch the layout — Paper first. No code.
- Build and iterate — Build the simplest version, get feedback
The Five-Second Rule¶
A good dashboard communicates its main insight in 5 seconds. If a reader has to spend 30 seconds figuring out what the dashboard says, it has failed — regardless of how technically sophisticated it is.
Test your dashboard: show it to someone for 5 seconds, cover it, and ask "What did you learn?" If they can't answer, redesign.
Layout Principles¶
Visual hierarchy — what the eye reads first¶
The top-left corner gets the most attention. Put the most important metric there. Readers in Western cultures scan in an F-pattern: left to right, top to bottom.
[ KPI 1: Most important ] [ KPI 2 ] [ KPI 3 ]
[ Main chart — biggest, most detailed ]
[ Supporting chart A ] [ Supporting chart B ]
Group related information¶
Charts that answer the same question should be near each other. Use whitespace (not lines/borders) to separate unrelated sections.
Consistent formatting¶
- Same font throughout
- 2-3 colours maximum
- Same number format (don't mix "£1,249" and "1249.00")
- Same chart style for the same type of data
Choosing the Right KPIs¶
A KPI (Key Performance Indicator) is a metric that: 1. Relates to a business goal — "We want to grow revenue by 15%" 2. Is actionable — seeing it red should trigger a specific response 3. Is timely — refreshes frequently enough to be useful 4. Has a target — you need to know if 58% is good or bad
| Bad KPI | Problem | Better KPI |
|---|---|---|
| "Total clicks" | More clicks ≠ more value | "Conversion rate from click to purchase" |
| "Number of support tickets" | Going up could mean more users, not worse product | "First contact resolution rate" |
| "Average order value" | Misleading if distribution is skewed | "Median order value" + percentile breakdown |
| "Revenue" | Context-free | "Revenue vs target (%)" or "Revenue YoY growth (%)" |
Dashboard Layout — Python (Matplotlib)¶
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
fig = plt.figure(figsize=(16, 10))
gs = gridspec.GridSpec(3, 3, figure=fig, hspace=0.4, wspace=0.3)
# KPI row — three big numbers
ax_kpi1 = fig.add_subplot(gs[0, 0])
ax_kpi2 = fig.add_subplot(gs[0, 1])
ax_kpi3 = fig.add_subplot(gs[0, 2])
for ax, title, value, delta, color in [
(ax_kpi1, "Total Revenue", "£156,240", "+18.3%", "#0D9488"),
(ax_kpi2, "Orders", "847", "+12.1%", "#0D9488"),
(ax_kpi3, "Avg Order Value", "£184.46", "+5.5%", "#0D9488"),
]:
ax.axis("off")
ax.text(0.5, 0.65, value, ha="center", va="center", fontsize=22, fontweight="bold", color=color)
ax.text(0.5, 0.35, delta, ha="center", va="center", fontsize=13, color=color)
ax.text(0.5, 0.1, title, ha="center", va="center", fontsize=10, color="#94A3B8")
ax.set_facecolor("#F8FAFC")
for spine in ax.spines.values():
spine.set_visible(False)
# Main chart — wide, full width
ax_main = fig.add_subplot(gs[1, :])
months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
revenue = [48250, 52100, 55800, 51200, 58900, 61400]
ax_main.bar(months, revenue, color="#0D9488", alpha=0.8, edgecolor="white")
ax_main.set_title("Monthly Revenue", pad=10)
ax_main.set_ylabel("£")
ax_main.grid(axis="y", alpha=0.3)
ax_main.yaxis.set_major_formatter(plt.FuncFormatter(lambda x, _: f"£{x/1000:.0f}k"))
# Bottom left — category breakdown
ax_cat = fig.add_subplot(gs[2, :2])
categories = ["Electronics", "Furniture", "Books", "Kitchen", "Sports"]
cat_rev = [52000, 38000, 28000, 22000, 16240]
ax_cat.barh(categories[::-1], cat_rev[::-1], color="#0D9488", alpha=0.7)
ax_cat.set_title("Revenue by Category")
# Bottom right — status pie
ax_status = fig.add_subplot(gs[2, 2])
statuses = ["Completed", "Pending", "Cancelled"]
counts = [640, 150, 57]
colors = ["#0D9488", "#F59E0B", "#EF4444"]
ax_status.pie(counts, labels=statuses, autopct="%1.0f%%", colors=colors, startangle=90)
ax_status.set_title("Order Status Mix")
fig.suptitle("Sales Dashboard — Q1 2024", fontsize=16, y=1.01)
plt.savefig("dashboard.png", dpi=150, bbox_inches="tight")
plt.show()
Common Dashboard Mistakes¶
Too many metrics
A dashboard with 25 KPIs communicates nothing. The reader doesn't know where to look. Limit to 5-7 key metrics per dashboard. If you need more, create multiple focused dashboards.
No context
"Revenue: £48,250" means nothing without context. Is that good? Add: target, previous period, or trend. "Revenue: £48,250 (+12% MoM, 96% of target)" is actionable.
Wrong chart for the metric
A pie chart for 12 categories, a bar chart for a time series, a table for data that should be a chart. Match the visual to the message.
Inconsistent date ranges
"YTD revenue" on one chart and "last 30 days" on another, on the same dashboard. Readers compare them accidentally. Be explicit about the date range on every chart.
Practice Exercises¶
Warm-up 1. Sketch (on paper) a 2×2 dashboard layout for a sales team showing: total revenue, order count, revenue by category (bar), and revenue trend (line). Add titles and think about which metric goes where. 2. List 5 KPIs for an e-commerce business and write one sentence for each explaining what decision it informs.
Main
3. Build the dashboard sketched in Q1 using matplotlib subplots.
4. Add KPI "cards" at the top: three text boxes showing total revenue, order count, and completion rate.
5. Add a target line to the revenue trend chart at £50,000/month.
Stretch
6. Build a function kpi_card(ax, title, value, delta, color) that draws a KPI card on a given Axes object. Use it to create a row of 4 KPI cards.
Interview Questions¶
[Beginner] What is the difference between a KPI and a metric?
[Mid-level] A stakeholder asks you to add 15 more metrics to an already-busy dashboard. How do you respond?
[Senior] How do you design a dashboard for two different audiences: a CEO (strategic, high-level) and a warehouse operations manager (tactical, real-time)? Should they be the same dashboard?