Add changes to allow for improved accessibility on charts. #1054
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows for improved a11y on the charts that use the
<SvgWrapper>
component.Currently,
<SvgWrapper>
has the default role on the tag set torole="img"
. This makes the chart inaccessible to screen readers. Adding a role prop to the<Bar>
component, and passing through to<SvgWrapper>
allows for accessibility by optionally setting the role togroup
.There's also the addition of the
ariaHidden
prop to theAxis
component. When this value is set totrue
and the chart is accessible, it will allow the user to skip over the values of the axes when using a screen reader which can improve the user experience.