Accessibility
BarChart, BarChartOrientation from @prepared911/ui/bar-chart.
label is required. It names the plot, a focusable region with role="application", and captions a data table that is visually hidden and in the accessibility tree: a column heading per series, a row heading per category, a cell per value. The table renders on the server and in print and never depends on hover. description is read after the name. The painted bars, labels, axes and tooltip are aria-hidden; the table and the live announcements carry the content.
The plot is in the tab order. Once focused, the pair of arrows on the category axis moves between categories (Left and Right in reading order for vertical bars; Up and Down for horizontal bars) and stops at the ends. The other pair moves between the bars of the current category in series order. Home and End jump to the first and last category. Escape dismisses the tooltip. Every (series, category) pair is reachable. Each move is announced through the live announcer as the category and the focused bar's row, joined with the locale's list punctuation, and the focused bar is outlined.
A category label is never cut with an ellipsis: it wraps inside its band (or the label column of horizontal bars), and only a band too narrow to wrap in thins labels, ending on the last category. The full text is always the tooltip title, the keyboard announcement and the table row heading, so a thinned label loses nothing for a screen reader.
Hovering a category shows the tooltip with every visible series and washes the category's band. A bar chart is read-only: it has no selection.
Legend entries are buttons with aria-pressed, pressed while the series is shown.
Bar colors come from Chroma's palette tokens, which clear 3:1 against every surface. Axis text, gridlines and the tooltip use the foreground, border and popup tokens. Under forced-colors: active the chrome uses system colors and bars keep their colors, because they carry the data.
The entrance reveal, the tooltip glide and the value-scale spring stop under prefers-reduced-motion. The chart is complete without them, and print turns the reveal off.