Skip to main content
Accessible charts ensure that all users, including those using assistive technologies, can understand your data. This guide covers accessibility best practices for Recharts.

Semantic structure

Provide descriptive titles

Always add a title that describes what the chart shows:

Add descriptive labels

Use ARIA labels for context:

Animation accessibility

Respect motion preferences

Recharts automatically respects the user’s prefers-reduced-motion setting when using isAnimationActive="auto":
This is the recommended approach for all animations.

Provide animation controls

For critical visualizations, offer users control:

Color and contrast

Ensure sufficient contrast

Use colors with WCAG AA compliant contrast ratios (at least 4.5:1 for text, 3:1 for UI components):

Don’t rely on color alone

Use patterns, shapes, or labels in addition to color:

Use accessible color palettes

Choose colorblind-friendly palettes:

Tooltips and interaction

Keyboard-accessible tooltips

Recharts tooltips are keyboard accessible by default. Ensure custom tooltips maintain this:

Focus indicators

Ensure interactive elements have visible focus states:

Alternative text representations

Provide data tables

Offer a table version for screen reader users:

Add text descriptions

Provide a text summary of key insights:

Axis accessibility

Label your axes

Always label axes clearly:

Format tick labels

Make tick values readable:

Legend accessibility

Ensure legends are readable

Provide context in legend labels

Responsive design

Adapt to different screen sizes

Support text scaling

Use relative units for text:

Testing accessibility

Screen reader testing

  1. Test with NVDA (Windows), JAWS (Windows), or VoiceOver (macOS)
  2. Navigate using keyboard only (Tab, Arrow keys)
  3. Verify all information is announced

Automated testing

Use tools like:

Manual checks

  • Can you navigate to all interactive elements with keyboard?
  • Are focus indicators visible?
  • Do tooltips work without a mouse?
  • Is color contrast sufficient?
  • Are animations respectful of motion preferences?
  • Is there alternative text representation?

ARIA attributes reference

Essential ARIA attributes for charts

Best practices checklist

Core accessibility principles
  • ✅ Provide text alternatives (titles, labels, descriptions)
  • ✅ Use sufficient color contrast
  • ✅ Don’t rely on color alone
  • ✅ Make interactive elements keyboard accessible
  • ✅ Respect motion preferences
  • ✅ Support responsive design and text scaling
  • ✅ Test with assistive technologies
Common pitfalls
  • ❌ Missing axis labels
  • ❌ Low color contrast
  • ❌ Forced animations that can’t be disabled
  • ❌ No alternative to visual representation
  • ❌ Small touch targets on mobile
  • ❌ Unlabeled data series
WCAG compliance levels
  • Level A: Basic accessibility (minimum)
  • Level AA: Recommended for most sites (includes 4.5:1 contrast)
  • Level AAA: Enhanced accessibility (includes 7:1 contrast)
Aim for at least WCAG 2.1 Level AA compliance.

Resources