Gráficos interativos navegáveis pelo teclado
Permita que as pessoas explorem pontos de dados sem usar o mouse.
Gráficos interativos navegáveis pelo teclado é uma aula grátis de Web Accessibility Academy no CoddyKit. Esta é a aula 4 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Web Accessibility Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Web Accessibility Academy inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em inglês.
Hover Is Not Enough
Interactive charts often reveal values only on hover. Keyboard and touch users never hover, so that data is locked away from them.
Make Data Points Focusable
Let users Tab to each data point or series by giving them tabindex="0". Now the keyboard can reach what the mouse hovers.
<circle tabindex="0" role="img" aria-label="March: 240 sales" />Each Point Needs a Name
A focusable point that announces nothing is useless. Give each one an accessible name stating its label and value, like March, 240 sales.
Arrow Keys to Move Between Points
Tabbing through 100 points is painful. Use arrow keys to step point-to-point and reserve Tab for jumping in and out of the chart.
The Roving tabindex Pattern
Keep one point at tabindex 0 and the rest at -1, moving the 0 as arrows fire. This roving tabindex keeps the Tab stop count sane.
Show Tooltips on Focus Too
Whatever a tooltip shows on hover, show on focus as well. Pair every mouseenter handler with a focus handler so both inputs match.
point.addEventListener('focus', showTooltip);Keep a Visible Focus Ring
Highlight the currently focused point with a clear outline or marker. Without it, keyboard users have no idea where they are.
Announce Changes Politely
When focus moves to a new point, an aria-live region can speak its value. This helps when the label is rendered visually but not in the DOM.
<div aria-live="polite">March: 240 sales</div>Group the Chart as a Figure
Wrap the whole thing in a figure with a name so users can find it and skip it as one unit when they are done exploring.
<figure role="group" aria-label="Sales over time, interactive"> ... </figure>Always Keep the Table Fallback
Interactivity is a bonus, not a replacement. Always keep the plain data table so users have a simple path when arrow-stepping is too slow.
Test With Tab and Arrows
Put the mouse away and drive the chart with Tab and arrow keys only. If you cannot reach every value, your users cannot either. ⌨️
Quick Check
How should a keyboard user step between many data points in a chart?
Recap: Charts You Can Drive
You learned to make points focusable and named, move with arrows via roving tabindex, mirror hover on focus, and always keep a table fallback. 🚀
Perguntas Frequentes
A aula “Gráficos interativos navegáveis pelo teclado” é grátis?
Sim — o texto completo de “Gráficos interativos navegáveis pelo teclado” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Web Accessibility Academy, atualize para CoddyKit PRO. O curso de Web Accessibility Academy inclui 4 aulas no total.
O que vou aprender em “Gráficos interativos navegáveis pelo teclado”?
Permita que as pessoas explorem pontos de dados sem usar o mouse. Você pratica Web Accessibility Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar Web Accessibility Academy?
Nenhuma experiência prévia é necessária. Web Accessibility Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 4 de 4.
Quanto tempo leva a aula “Gráficos interativos navegáveis pelo teclado”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de Web Accessibility Academy?
Sim. Cada aula de Web Accessibility Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- Todo gráfico precisa de uma alternativa textual
- A alternativa da tabela de dados
- Cor, padrão e rótulos diretos
- Gráficos interativos navegáveis pelo teclado