Who this is for
Data Visualization Engineers and BI practitioners who must compare categories, versions, or time periods, and show how parts contribute to a total in clear, decision-ready visuals.
Prerequisites
- Basic chart literacy (bar/line/area/pie).
- Comfort with categorical and time-based data.
- Ability to compute percentages and sort/rank categories.
Why this matters
In real projects you will:
- Compare A/B test results across segments.
- Show product sales by region and how each region contributes to total revenue.
- Reveal budget vs. actuals and which components drove the variance.
- Track market share composition over time to flag shifts.
Choosing the right comparative or part-to-whole visual makes patterns obvious and decisions faster.
Concept explained simply
Two common analytic tasks:
- Comparative: Which is bigger/smaller? By how much? How did it change?
- Part-to-whole: What makes up the total? What share does each part have?
Mental model
Match the task to the most accurate visual encoding:
- Highest accuracy: position on a common baseline (grouped bars, dot plots).
- Next: length (bars, lollipops).
- Lower accuracy: angle/area (pie, donut, treemap). Use when communicating composition at a glance, not fine precision.
Quick rules of thumb
- Compare magnitudes: horizontal bar chart sorted by value.
- Compare two points per category: slope chart or dot plot with connecting line.
- Compare many groups across few categories: grouped bars or small multiples.
- Part-to-whole (one point): pie/donut (≤6 slices), or treemap for many parts.
- Part-to-whole across time: stacked area (for trends) or stacked bars (discrete periods).
- Relative composition across categories/time: 100% stacked bars.
Choosing the right visual
- Single-category comparison (10–30 items): sorted horizontal bars.
- Compare two measures per category (e.g., plan vs. actual): grouped bars or bullet chart.
- Compare before vs. after for each category: slope chart (few categories) or dot plot.
- Show change drivers to total: waterfall chart.
- Part-to-whole with few parts (≤6): donut/pie; label shares directly.
- Part-to-whole with many parts: treemap or bars with “Other” grouped.
- Part-to-whole across time: stacked area for smooth trends, 100% stacked bars to compare relative shares.
When to avoid certain charts
- Pie/donut with many slices or tiny differences: use bars instead.
- Stacked bars for comparing non-baseline segments across categories: use grouped bars or 100% stacked bars.
- Dual axes with different scales: prefer normalization or small multiples.
Worked examples
Example 1: Compare quarterly sales by product
Task: Compare Q1 vs. Q2 sales across five products and see which grew the most.
- Recommended: dot plot per product (two dots Q1 and Q2) with a line, or grouped bars.
- Why: shared baseline/position comparison is precise; the connecting line shows direction of change.
Design notes
- Sort products by Q2 value or absolute change.
- Color encode increase vs. decrease lightly; use labels for deltas.
Example 2: Market share by region
Task: Show composition of market share across four competitors in three regions and compare relative dominance.
- Recommended: 100% stacked bars with one bar per region.
- Why: relative shares are the focus; percentages sum to 100% per region.
Alternative
Use small multiples of pies (one per region) only if ≤4 slices and differences are large. Otherwise 100% stacked bars are easier to compare.
Example 3: Budget vs. actuals and drivers
Task: Show which line items drove the variance to total budget.
- Recommended: waterfall chart from budget to actual with increases/decreases by line item.
- Why: isolates contribution of each part to the final difference.
Design notes
- Order steps logically (e.g., revenue drivers then cost drivers).
- Label totals and key drivers directly.
Exercises
Do these without tools first; sketch on paper. Then build in your favorite BI tool.
Exercise 1 — Pick the right chart
You have product mix for three regions (North, South, West). Each region sells five products (A–E). Stakeholder goals: (1) compare each product’s share within a region, (2) see which product dominates per region, (3) quickly compare regions.
Deliverable: choose a single primary chart type and list key design choices (ordering, labels, colors).
- Timebox: 8 minutes.
- Accuracy check: can a viewer answer the three goals in under 10 seconds?
Show solution
Use 100% stacked bars with one bar per region; segments are products A–E. Sort regions by the share of the top product or by a consistent rule (alphabetical) and order segments consistently across bars. Label overall region shares by top product and add exact percentages on hover or as data labels if space allows. Alternative: three small-multiple pies if ≤5 products and shares are distinct, but 100% stacked bars remain easier to compare across regions.
Exercise 2 — Fix the visual
You’re given a pie chart with 12 expense categories. The top two categories are 28% and 22%; the rest are 5–8% each. Redesign to communicate the composition clearly and highlight top drivers.
Deliverable: specify chart type, ordering, labeling, and any grouping.
- Timebox: 7 minutes.
- Accuracy check: can a viewer see the top 3 and the long tail instantly?
Show solution
Use a sorted horizontal bar chart of categories by percentage. Label bars with exact % values and cumulative % at the end of each bar if helpful. Optionally group small categories into “Other” to keep to ≤8 bars and show an explorable breakdown elsewhere. Keep a zero baseline. Alternatively, a treemap works if space is tight, but bars allow easier ranking.
Self-check checklist
- Did you choose position/length encodings for precise comparisons?
- Are categories sorted in a meaningful order?
- Is there a clear baseline (zero for bars) when comparing magnitudes?
- For composition, can viewers read proportions without decoding a legend maze?
- Did you keep pie/donut slices to ≤6 and label shares directly?
Common mistakes and how to self-check
- Too many slices in pies/donuts. Fix: switch to bars or group into “Other”.
- Comparing non-baseline segments in stacked bars. Fix: use grouped bars or 100% stacked bars if relative shares matter.
- Non-zero baseline for bars. Fix: always start at zero for length comparisons.
- Overusing dual axes. Fix: normalize, use small multiples, or split charts.
- Color overload. Fix: use muted palette; only highlight what matters.
- Inconsistent category order across panels. Fix: lock a common order for comparability.
Practical projects
Project 1: Channel mix dashboard
- List acquisition channels and weekly sessions for 12 weeks.
- Build stacked area for absolute trend and 100% stacked bars per week to compare mix.
- Add a small multiple of top 3 channels for deep dives.
Project 2: Cost structure breakdown
- Collect monthly expenses by category.
- Show current month composition as sorted bars with top N + Other.
- Add a waterfall from budget to actual to explain variance.
Project 3: Product adoption comparison
- Take 6 cohorts and measure conversion at 3 milestones.
- Use slope charts (3 points) per cohort as small multiples.
- Highlight cohorts with the steepest drop.
Learning path
- Start: Basic bar/line literacy and labeling best practices.
- This subskill: comparative visuals (bar, dot, slope) and part-to-whole (stacked, pie/donut, treemap).
- Next: highlighting/annotation, small multiples, and dashboard layout for comparisons.
- Later: perceptual principles and interaction patterns for comparisons.
Next steps
- Apply one worked example to your current dataset today.
- Replace one pie/donut in your dashboard with a bar or 100% stacked bar and measure time-to-insight with a teammate.
- Take the quick test below. Everyone can take it for free; only logged-in users get saved progress.
Mini challenge (10 minutes)
You track five features’ usage across two releases. In 10 minutes, sketch a visual that shows which features gained or lost share of total usage while also allowing absolute comparison. Write 3 design choices you made and why.
Quick Test
Take the test to check your understanding. Everyone can take it for free; only logged-in users get saved progress.