WCAG 2.1 AA — release blocker
Chart must satisfy these on every render before it ships.
Responsive container
ChartContainerrenders aResponsiveContainerthat fills its parent width.- The chart reflows on resize — no horizontal scrolling.
Color and contrast
- Colors are sourced from the
ChartConfigand mapped to CSS custom properties. - Never rely on color alone to distinguish data series — the legend displays text labels alongside color swatches.
- Ensure a minimum 3:1 contrast between adjacent bars/lines and the chart background.
Tooltips
ChartTooltiprenders on hover/focus and provides exact numerical values for each data point.- Tooltip content is rendered in the DOM (not canvas) and is readable by screen readers.
Keyboard navigation
| Key | Action |
|---|---|
Tab | Move focus to the chart container. |
Arrow Left / Right | Navigate between data points (when supported by Recharts). |
Labelling
- Provide descriptive axis labels or an
aria-labelon the chart container describing what the chart shows. - When a chart has measurable x/y values, render both axes unless the surrounding UI provides an equivalent text summary.
- For polar charts, render
PolarAngleAxislabels and use a boundedPolarRadiusAxisdomain so users can understand the scale. - The legend maps colors to human-readable series names.
Reduced motion
- Recharts animations respect
prefers-reduced-motionwhenisAnimationActiveis set appropriately.
Audit checklist
- Chart container is responsive and does not overflow
- Legend labels present for every data series
- Tooltip shows exact values on hover/focus
- 3:1 contrast between data series and background
- Color is not the only differentiator (legend text present)
- Axis labels or aria-label describe chart purpose