Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Bar Chart
  3. Accessibility

Bar Chart

Accessibility

Import BarChart, BarChartOrientation from @prepared911/ui/bar-chart.
Name, description and table
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.
Keyboard
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.
Long labels
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.
Pointer
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
Legend entries are buttons with aria-pressed, pressed while the series is shown.
Color and contrast
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.
Motion
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.
Previous
Bar Chart / API and Development
Next
Breadcrumb / Usage
On this page
Name, description and table
Keyboard
Long labels
Pointer
Legend
Color and contrast
Motion