shadcn.io is not affiliated with official shadcn/ui
Vertical Bar Chart Stats Block for React
Seven weekday columns for a gym's check-ins in a card in card, the busiest day drawn in full and the others at 30%, with the count above each column and a one-line takeaway under the axis.
Installation
Overview
A vertical bar chart for React with Base UI. A centred header names the busiest weekday and its share of the week, then a narrow card in card (a muted shell around a raised panel) holds the week's total check-ins, rolling up once in view, the busiest day, and seven rounded columns, one per weekday, with the count written above each. The busiest day is drawn at full strength and the other six at 30%, so the eye lands on it before it reads a number. Under the axis a one-line takeaway compares the quietest day with the busiest. Every column height, count, share and sentence is computed from one list of daily counts, so the drawing and the text can't disagree. The columns are plain CSS boxes in your theme's foreground colour: no chart library, and no colour to mean good or bad. For a gym, a studio, a coworking space, or any page that shows a weekly rhythm.
FAQ
How do I change the days and the counts?
Edit DAYS at the top of the file: each entry has a full name, a short name for the axis and a count. The total, the busiest and quietest days, the column heights, the shares in the headline and the takeaway are all computed from it. Keep seven entries so the grid keeps its seven columns, or change grid-cols-7 to match.
How are the columns sized?
Each column's height is its count as a share of the biggest count, so the busiest day fills the plot and the others scale from it. The count sits just above its column, and the plot has room above it for the label. The axis starts at zero: a column twice as tall is twice the count.
Is it accessible?
Yes. The columns are a list: each item reads the weekday and then its count ("Monday: 412"), and the drawn bars and the axis labels are hidden from assistive technology because the list says the same. The takeaway is the figure's caption. Counts sit in bdi elements, and the plot is left to right in right-to-left pages, so the week still starts with Monday at the start of the line.
Why is only one column drawn in full?
Emphasis comes from weight, not colour: the busiest day is the text colour at full strength and the rest are 30% of it, so it works in every theme and doesn't claim that a busy day is good or bad. If a day needs to raise an alarm, give it a status icon rather than tinting the bar.
Related
- Pro
Weekly Breakdown Bar Chart Stats
Bar and columnA week of screen time as seven cells in one band from rail to rail, each with the day, its time and a meter that fills from the foot, the lightest day marked with a badge; seven rows with horizontal meters on a phone.
- Pro
Target Line Bar Chart Stats
Bar and columnFourteen daily bars against a labelled quota line in a framed chart, days at or above the quota solid and days below it outlined, with a two-cell band under it for days met and the average against the quota.
- Pro
Grouped Bar Chart Stats
Bar and columnTwo bars per month, this year solid and last year lighter, with a Chart and Table switch that swaps the drawing for a real table of the same numbers in the same box.
- Pro
Lollipop Chart Stats
Bar and columnA week of steps as seven thin stems topped by dots, the count above each, a goal hairline and a ring around the peak, in a split with the week's total, the daily average and the days at goal.
- Pro
Horizontal Bar Chart Card Stats
Bar and columnNine ranked survey answers where each row is its own bar: a quiet fill from the start behind the label, the share and the count at the end, and the leading row a little stronger.
- Pro
Hero Metric Card Stats
Hero metricOne headline figure for a treasury tool, cash on hand in a big number inside a card in a card, with a change pill, a comparison and a two-line footnote that says when it was read and from where.