Nº 475 of 520
Weekly bar chart
Seven bars for a yard week. One series, one selected day, and a mono readout. No legend, no second colour, no chart theme.
Preview
Use it
Free to use · credit appreciated1 Once, in your project
npx skills add SusanAcharya/Design-Lounge 2 Then ask
Using the Design Lounge skill, build "Weekly bar chart" (piece chart-bar-week) in my stack. Match its brief; restyle it onto my product's theme.
No skill? Paste the brief instead. It carries the numbers, tokens and behaviour.
<!-- Design Lounge Nº 475 · "Weekly bar chart" · designlounge.vercel.app -->
# Weekly bar chart
> **Build brief for a coding agent.** Rebuild this piece in the reader's stack. If they haven't said which stack, ask once, then default to semantic HTML + CSS + a little vanilla JS. Match the numbers below; don't "improve" them. When a kit is locked, map colours onto the kit tokens. The bars stay one series.
## What it is
A weekly bar chart for yard runs. The page is warm paper. A title and a date range sit above a white card, max width 880px. Inside, a quiet axis (60, 30, 0) and seven bars for Monday through Sunday. Resting bars are warm gray. The selected bar, and the bar under the pointer, is the primary green. A mono line under the chart reads the day and the count. Wednesday starts selected: 51 runs. There is no legend, no grid of colours, and no imported chart theme. This is the chart an ops home uses beside a KPI row. It is not a marketing graphic.
## Reference behaviour
1. Wednesday starts with `aria-pressed="true"`. The readout is "Wednesday · 51 runs".
2. Pointer enter or click on a day selects it and rewrites the readout as "{Day} · {n} runs".
3. Only one day is pressed. The others return to gray.
4. Bars rise from the baseline on load, 420ms, `cubic-bezier(0.2, 0.7, 0.2, 1)`, `transform-origin: bottom`.
5. Reduced motion: the rise animation is removed. Bars render at full height. Selection still works.
6. The axis is `aria-hidden`. The buttons carry the day and the count.
7. Focus ring is 2px `--focus`, offset 2px.
8. Do not add a tooltip that floats over the bar. The readout is the value.
## Structure
```
padding 48px 64px
h1 + date line
card, max-width 880, radius 2
plot: 36px axis | seven buttons
readout
```
- Each day is a `button` inside a group labelled "Runs by day".
- The bar is an `i` with a percentage height. The scale is 60 runs = 100 percent of the plot.
## Tokens
```css
:root {
--bg: #f6f4ef;
--surface: #ffffff;
… 123 more lines. Copy or download for the full brief. Loading the source…Brief
163 linesBuild brief for a coding agent. Rebuild this piece in the reader’s stack. If they haven’t said which stack, ask once, then default to semantic HTML + CSS + a little vanilla JS. Match the numbers below; don’t “improve” them. When a kit is locked, map colours onto the kit tokens. The bars stay one series.
What it is
A weekly bar chart for yard runs. The page is warm paper. A title and a date range sit above a white card, max width 880px. Inside, a quiet axis (60, 30, 0) and seven bars for Monday through Sunday. Resting bars are warm gray. The selected bar, and the bar under the pointer, is the primary green. A mono line under the chart reads the day and the count. Wednesday starts selected: 51 runs. There is no legend, no grid of colours, and no imported chart theme. This is the chart an ops home uses beside a KPI row. It is not a marketing graphic.
Reference behaviour
- Wednesday starts with
aria-pressed="true". The readout is “Wednesday · 51 runs”. - Pointer enter or click on a day selects it and rewrites the readout as “{Day} · {n} runs”.
- Only one day is pressed. The others return to gray.
- Bars rise from the baseline on load, 420ms,
cubic-bezier(0.2, 0.7, 0.2, 1),transform-origin: bottom. - Reduced motion: the rise animation is removed. Bars render at full height. Selection still works.
- The axis is
aria-hidden. The buttons carry the day and the count. - Focus ring is 2px
--focus, offset 2px. - Do not add a tooltip that floats over the bar. The readout is the value.
Structure
padding 48px 64px
h1 + date line
card, max-width 880, radius 2
plot: 36px axis | seven buttons
readout
- Each day is a
buttoninside a group labelled “Runs by day”. - The bar is an
iwith a percentage height. The scale is 60 runs = 100 percent of the plot.
Tokens
:root {
--bg: #f6f4ef;
--surface: #ffffff;
--ink: #161513;
--ink-2: #5a554c;
--ink-3: #8a847a;
--line: #e4dfd4;
--bar: #d9d3c7;
--primary: #1f4d3a;
--focus: #1f4d3a;
--font-text: "IBM Plex Sans", system-ui, sans-serif;
--font-mono: "IBM Plex Mono", ui-monospace, monospace;
--radius: 2px;
}
When a kit is locked, --bar is --line or --surface-2, and the selected bar is --primary. Do not keep #1f4d3a beside another theme.
Typography
- Title: IBM Plex Sans 500, 28px, tracking -0.03em.
- Date line: 13px,
--ink-2. - Axis: IBM Plex Mono 11px,
--ink-3. - Day labels: 12px, weight 500. Selected day weight 600,
--ink. - Readout: IBM Plex Mono 13px.
- One text face, one mono. No display serif.
Motion
| Trigger | Property | From | To | Duration | Easing |
|---|---|---|---|---|---|
| Load | transform scaleY | 0 | 1 | 420ms | cubic-bezier(0.2, 0.7, 0.2, 1) |
Reduced motion sets animation: none. Selection does not animate colour.
States
- Bar resting:
#d9d3c7. - Bar hovered or pressed:
#1f4d3a. - One pressed day.
- Readout matches the pressed or hovered day.
Accessibility
- Days are buttons, not a canvas.
- The group has an accessible name.
- The readout is text, so colour is not the only way to read the value.
- Contrast of
#161513on#ffffffis above 4.5.#1f4d3ais a fill, not small text. - Hit area is the full column, not only the painted bar.
Responsive rules
- At 1280 the card is 880px and the plot is 280px tall.
- At 768 the page padding becomes 24px and the day gap becomes 8px.
- Below 640 the axis stays, and day labels remain one line. Do not rotate them.
Acceptance checklist
- Seven days, Monday to Sunday.
- Counts are 42, 38, 51, 29, 46, 18, 12.
- Scale is 60 at the top.
- Wednesday starts selected.
- Readout is mono and names the day and the count.
- Resting bars are one gray. Selected is one green.
- Bars rise once. Reduced motion skips the rise.
- No legend, no second series, no pie.
- Card radius is 2px.
Implementation notes
Heights are n / 60 * 100 rounded: 70, 63, 85, 48, 77, 30, 20. Do not compute a different scale.
Rebuild order:
- Page
#f6f4ef, padding 48px 64px. - Title “Runs this week”, 28px, weight 500.
- Subtitle “Bay totals · 28 Sep – 4 Oct”.
- Card fill white, border
#e4dfd4, radius 2, padding 24px 24px 16px, max-width 880. - Plot height 280px. Axis column 36px.
- Seven buttons, gap 12px, aligned to the bottom border.
- Bar max-width 48px, top radius 2px, bottom square.
- Wednesday pressed on first paint.
- Readout margin-top 16px.
- Hover and click both call the same select function.
Copy you keep:
- Monday 42, height 70%.
- Tuesday 38, height 63%.
- Wednesday 51, height 85%.
- Thursday 29, height 48%.
- Friday 46, height 77%.
- Saturday 18, height 30%.
- Sunday 12, height 20%.
- Axis labels 60, 30, 0.
- Selected fill
#1f4d3a. Resting fill#d9d3c7. - Readout pattern is “Wednesday · 51 runs”.
Common mistakes:
- A Chart.js or Recharts default palette.
- A blue series and an orange series.
- A legend under the card.
- Gridlines on every 10 runs.
- Rotated day labels.
- A floating tooltip that covers the bar.
- Animating the bars in a loop.
- Using the sparkline piece as a substitute. Sparks are the KPI row. This is the week.
Where it sits in a product:
- Put it under the KPI spark row, not instead of the table.
- The week is one question: which day was heavy.
- Do not add a compare-to-last-week line on this piece.
- Do not filter the bars from a date picker. The range is the subtitle.
- The card does not scroll. Seven days fit.
- If the product is a phone, keep seven bars and drop the axis labels to 0 and 60 only.
- The readout stays under the plot, left aligned with the card padding.
- Selection survives hover: leaving the plot keeps the last selected day.
- Do not colour Saturday and Sunday in a second ink.
- The title is the only heading. The card has no inner title.
Details
- Palette
- Type
- IBM Plex Sans · IBM Plex Mono
- Motion
- Subtle motion
- Build
- Quick build
- Tags
On the shelves