You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check this if you would like to implement a PR, we are more than happy to help you go through the process.
What problem are you trying to solve?
The underlying lib Chart.js renders everything on a canvas. So it's up to us as developers to make charts accessible by providing ARIA attributes / an appropriate role. In the Chart.js docs are some hints about how to make the charts accessible: https://www.chartjs.org/docs/latest/general/accessibility.html
In my opinion there are four things that should be supported by properties / slots and added to the canvas element.
role: should be defaulted to img to help e.g. screen readers to interpret the canvas semantic (image of a chart)
aria-label: should be supported by a property to describe the image / chart for visually impaired users
Fallback-Content: should be supported by a Slot to be able to show when the Browser isn't able to render the canvas
aria-describedby should be supported by a property to be able to refer to a describing element (e.g. a table representation of the data)
All the points are currently only be able to implement by accessing the ref of the canvas and modifying it which is quite complicated.
The result could look like this:
<canvasid="myChartCanvas"
width="400"
height="100"
aria-label="myAriaLabel" role="img"
aria-describedby="rawChartDataAsTable">
Some fallback content displayed, when the canvas could not be rendered.
</canvas><tableid="rawChartDataAsTable"> ... </table>
Describe alternatives you've considered
Documentation, Adoption, Migration Strategy
This shouldn't be a breaking change.
The text was updated successfully, but these errors were encountered:
d-koppenhagen
changed the title
a11y: provide
a11y: support ARIA attributes, role and fallback content for canvas
Nov 21, 2023
Would you like to work on this feature?
What problem are you trying to solve?
The underlying lib Chart.js renders everything on a canvas. So it's up to us as developers to make charts accessible by providing ARIA attributes / an appropriate role. In the Chart.js docs are some hints about how to make the charts accessible:
https://www.chartjs.org/docs/latest/general/accessibility.html
Currently this wrapper lib creates only a plain
canvas
element:https://github.com/apertureless/vue-chartjs/blob/main/src/chart.ts#L115-L117
Describe the solution you'd like
In my opinion there are four things that should be supported by properties / slots and added to the
canvas
element.role
: should be defaulted toimg
to help e.g. screen readers to interpret the canvas semantic (image of a chart)aria-label
: should be supported by a property to describe the image / chart for visually impaired usersaria-describedby
should be supported by a property to be able to refer to a describing element (e.g. a table representation of the data)All the points are currently only be able to implement by accessing the ref of the canvas and modifying it which is quite complicated.
The result could look like this:
Describe alternatives you've considered
Documentation, Adoption, Migration Strategy
This shouldn't be a breaking change.
The text was updated successfully, but these errors were encountered: