Skip to content

Commit d42de9b

Browse files
spec: add bar-stacked-labeled specification (#3507)
## New Specification: `bar-stacked-labeled` Related to #3504 --- ### specification.md # bar-stacked-labeled: Stacked Bar Chart with Total Labels ## Description A stacked bar chart that displays multiple data series stacked on top of each other with total value labels prominently shown above each bar stack. This variant combines part-to-whole visualization with explicit numerical annotations, making it easy to read both individual segment contributions and cumulative totals at a glance. The total labels eliminate the need for mental arithmetic when comparing overall values across categories. ## Applications - Comparing quarterly sales by product line with clear total revenue figures for executive presentations - Displaying project budget breakdowns by task category with visible total costs for each project phase - Visualizing survey response distributions with total respondent counts labeled for each question ## Data - `category` (categorical) - Labels for each bar group on the x-axis (e.g., quarters, departments, regions) - `component` (categorical) - The different series being stacked within each bar (e.g., product lines, cost types) - `value` (numeric) - Size of each segment representing the measured quantity - Size: 3-8 categories with 2-5 stacked components recommended for readability - Example: Quarterly revenue by product category, department expenses by cost type ## Notes - Total labels should be placed directly above each complete bar stack with clear formatting - Use a consistent number format for labels (e.g., rounded integers, one decimal place, or with units) - Ensure adequate vertical space above the tallest bar for label placement - Consider using a slightly larger or bold font for total labels to distinguish from segment labels - Segment labels within the bars are optional but can enhance readability for larger segments --- **Next:** Add `approved` label to the issue to merge this PR. --- :robot: *[spec-create workflow](https://github.com/MarkusNeusinger/pyplots/actions/runs/20856585839)* Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent c01705d commit d42de9b

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# bar-stacked-labeled: Stacked Bar Chart with Total Labels
2+
3+
## Description
4+
5+
A stacked bar chart that displays multiple data series stacked on top of each other with total value labels prominently shown above each bar stack. This variant combines part-to-whole visualization with explicit numerical annotations, making it easy to read both individual segment contributions and cumulative totals at a glance. The total labels eliminate the need for mental arithmetic when comparing overall values across categories.
6+
7+
## Applications
8+
9+
- Comparing quarterly sales by product line with clear total revenue figures for executive presentations
10+
- Displaying project budget breakdowns by task category with visible total costs for each project phase
11+
- Visualizing survey response distributions with total respondent counts labeled for each question
12+
13+
## Data
14+
15+
- `category` (categorical) - Labels for each bar group on the x-axis (e.g., quarters, departments, regions)
16+
- `component` (categorical) - The different series being stacked within each bar (e.g., product lines, cost types)
17+
- `value` (numeric) - Size of each segment representing the measured quantity
18+
- Size: 3-8 categories with 2-5 stacked components recommended for readability
19+
- Example: Quarterly revenue by product category, department expenses by cost type
20+
21+
## Notes
22+
23+
- Total labels should be placed directly above each complete bar stack with clear formatting
24+
- Use a consistent number format for labels (e.g., rounded integers, one decimal place, or with units)
25+
- Ensure adequate vertical space above the tallest bar for label placement
26+
- Consider using a slightly larger or bold font for total labels to distinguish from segment labels
27+
- Segment labels within the bars are optional but can enhance readability for larger segments
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Specification-level metadata for bar-stacked-labeled
2+
# Auto-synced to PostgreSQL on push to main
3+
4+
spec_id: bar-stacked-labeled
5+
title: Stacked Bar Chart with Total Labels
6+
7+
# Specification tracking
8+
created: 2026-01-09T15:23:21Z
9+
updated: null
10+
issue: 3504
11+
suggested: MarkusNeusinger
12+
13+
# Classification tags (applies to all library implementations)
14+
# See docs/reference/tagging-system.md for detailed guidelines
15+
tags:
16+
plot_type:
17+
- bar
18+
- stacked
19+
data_type:
20+
- categorical
21+
- numeric
22+
domain:
23+
- general
24+
- business
25+
features:
26+
- stacked
27+
- annotated
28+
- comparison

0 commit comments

Comments
 (0)