Accessibility and charts: what should it do? #4484
Replies: 3 comments 9 replies
-
First, just want to say that I love that you're looking at this, and I absolutely agree that we should have a coherent, unified approach to accessibility at recharts. Also, I wish I could point to something and say "these guys did chart accessibility right, let's copy them", but that doesn't exist. I elaborated on that in this draft post for the A11yProject. Anyway, let's go through these comments:
Yes, it should use arrow keys. No, it should not use the TAB key. If you make every element in the chart a tab stop, then a user who doesn't care about that chart has to tab through every single tab stop just to get past it. If the element is a single tab stop, then a user can just move on to the stuff they actually care about. fyi, this practice of tabbing to a container, and arrowing between items in the container, is very common. See the WAI-ARIA authoring practices for tabs, listboxes, and toolbars.
I don't understand the question. Even though the accessibility code exists on the chart level, practically we're just making the tooltip accessible. Are you asking if we should display a tooltip by default?
Let's break this up between the focus indicator (something visual), and DOM focus. I think the chart should have DOM focus. As for the focus indicators, if there's a tooltip, the vertical line of the tooltip is doing the job of the indicator. iirc, the pie chart didn't have a vertical line like that, the visual treatment of the pie chart slice provides the indication.
Great question. For a keyboard-only user, I think up/down would be intuitive, but left/right would be discoverable. That said, we could always support both up/down and left/right for vertical charts, since we don't do anything with up/down arrow keys right now. However, if we just support left/right arrow keys, I think keyboard-only users will figure it out quickly, and screen reader users won't notice the difference. In Chart2Music, I stick to left/right arrow keys, but that's because I use up/down arrow keys to do something different.
The visuals of the focus indicators should be configurable. The information provided in the tooltip is already configurable.
I believe that changing accessibility from off-by-default to on-by-default is a breaking change. I'm not sure what else would count, though. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply! With the tooltip showing question - I am not certain if or how a screen reader will react to it. If there's no DOM focus on the tooltip, and the screen reader doesn't read it, then a visually impaired user won't know about it? Perhaps the tooltip information should be included in the sector aria label by default? Or the tooltip should have some aria dynamic content attributes? Or do all screen readers just handle it out of the box and I don't need to worry? Sorry if it's a silly question, I don't have tons of experience designing a11y in charts 😬 we would usually avoid tooltips for this reason but I don't think that's an option for chart library. @ckifer mentioned tooling. Are there any common tools you recommend that we should include and observe the output? |
Beta Was this translation helpful? Give feedback.
-
One more question, should the tooltip wrap or not? I imagine that charts like RadialBar and Pie should wrap (or perhaps all polar charts should?) but Area and Bar should not. Is this difference helpful? Or perhaps should all wrap? |
Beta Was this translation helpful? Give feedback.
-
I'm looking for your input in Recharts and keyboard controls and accessibility.
Currently, Recharts has a little bit of everything:
I would like to unify this behaviour a little bit and fill in the gaps. I have questions and I would like to hear your thoughts or preferences on what Recharts should do:
Beta Was this translation helpful? Give feedback.
All reactions