← Back to Course

Module 18

Data Visualization

Part B

Print vs Web

09

undefined

undefined

Part C

Science & Psychology

10

undefined

undefined

undefined
Visual Perception

undefined

undefined
Pre-attentive Processing

undefined

undefined
Working Memory

undefined

Part D

Real-World Examples

11

Effective Data Visualization

Real-world examples of clear data communication.

Annotation-Rich

Story-first visualization

Principles Identified:
Narrative Charts tell stories with annotations
Simplicity One chart, one message
Context Comparisons make data meaningful

Business Metrics

Clean, actionable data

Principles Identified:
Clarity High data-ink ratio
Hierarchy Key metrics prominent
Interactive Drill-down for details

Research Data

Long-term trends

Principles Identified:
Sources Full data transparency
Interactivity Explore data yourself
Accessibility Download, embed, share

Part E

Common Failures

12

Data Visualization Mistakes

Common errors that mislead or confuse readers.

Failure: Truncated Y-Axis

Y-axis: 95-100 (looks 3× bigger!)

Fix: Start bar charts at zero

Y-axis: 0-100 (true proportion)

Failure: 3D Chart Effects

🥧 3D Pie

Perspective distorts slice sizes

Fix: Use flat 2D representations

Flat bar chart

Accurate comparison

Failure: Rainbow Color Scales

Yellow looks brightest (false emphasis)

Fix: Use perceptually uniform scales

Viridis: perceptually uniform

Failure: Too Many Categories

15-slice pie chart

Impossible to compare tiny slices

Fix: Limit to 4-5, group the rest

Top 4 + "Other"

Clear, digestible

Part F

Visual Tests

13

Chart Quality Tests

Validate your visualizations meet these criteria.

01

5-Second Test

Tests: Instant comprehension

Show chart for 5 seconds, ask what it shows. If viewers can't state the main insight, simplify.

⏱️

What's the takeaway?

02

Colorblind Test

Tests: Color accessibility

View in grayscale or use colorblind simulator. 8% of men are red-green colorblind. Use patterns or direct labels as backup.

🔴 vs 🟢

Indistinguishable to 8% of men

03

Mobile Test

Tests: Responsive design

View on phone. Labels must be readable (16px min), touch targets usable (44px min). Consider simplified mobile version.

📱

Readable on small screens?

04

Honesty Test

Tests: Accurate representation

Check axis scales, proportions, cherry-picked ranges. Would a statistician approve? Misleading charts damage trust.

Y-axis starts at 0?

Full date range shown?

Proportions accurate?

Part G

CSS Implementation

14

CSS Data Visualization

Lightweight CSS-only solutions for simple charts.

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 200px;
}

.bar {
  flex: 1;
  background: var(--primary);
  height: var(--value);
  transition: height 0.3s ease;
}

/* Usage: style="--value: 75%" */
CSS Bar Chart via CSS
  • Flexbox layout - Bars align to bottom automatically
  • CSS custom property - --value for dynamic heights
  • Transition - Smooth animation on data change
.donut {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: conic-gradient(
    var(--c1) 0% var(--p1),
    var(--c2) var(--p1) var(--p2),
    var(--c3) var(--p2) 100%
  );
  mask: radial-gradient(
    circle, transparent 60%, black 60%
  );
}
CSS Donut Chart via CSS
  • conic-gradient - Creates pie segments
  • mask - Cuts center for donut hole
  • CSS variables - Dynamic percentages and colors
.progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: var(--progress, 0%);
  background: var(--primary);
  transition: width 0.5s ease-out;
}
Progress Bar via CSS
  • overflow: hidden - Clips the fill to container
  • --progress variable - Set dynamically for updates
  • Transition - Smooth animation on change

Part H

Self-Assessment

15

Self-Assessment

Test your data visualization knowledge.

Q1

Why should bar charts start at zero?

Click to reveal
Q2

What is the most accurately perceived visual encoding?

Click to reveal
Q3

Why are rainbow color scales problematic?

Click to reveal
Q4

When should you use direct labels vs legends?

Click to reveal
Q5

How many categories should a pie chart have?

Click to reveal

Key Takeaways

Maximize Data-Ink Ratio undefined

undefined

Use Position for Precision undefined

undefined

Match Chart to Story undefined

undefined

Label Directly undefined

undefined

Test for Accessibility undefined

undefined