Treat focus, selection and the data table as part of the chart's public interface.
Interactive charts: make selection work without a pointer
Hover is not access
A tooltip visible only on pointer hover excludes keyboard and many touch users. Give each interactive mark a reachable focus target, a meaningful accessible name and the same detail on focus as on hover. Arrow keys can move within a series, while Home and End can jump to its bounds; publish the key rules next to the chart. Keep a visible focus indicator. Color and text alternatives cover the static layer, but a chart with filters and selections also needs an interaction contract.
Separate focus from selection
Focus says where keyboard input will act. Selection says which records are included in the current analysis. Do not silently change the filter merely because focus moved to another point. If Enter selects a point, announce the new selection and update the related table or summary. A selected range should survive a resize and a redraw by stable record IDs rather than pixel coordinates. Linked filters and cohort state should make the selected population and denominator visible across all charts.
Avoid a thousand tab stops
Putting every mark in the page's normal Tab sequence can make a dense chart unusable. A single chart entry point followed by arrow-key movement may be better, provided the active point's name and value are exposed, the user can exit with Tab, and the navigation order is predictable. Do not trap focus inside the plot. For large series, offer direct search, a bounded table, or a downloadable data file so a user does not have to press an arrow 4,700 times. Large-series reduction must preserve access to underlying records when visual points are aggregated.
The table is a first-class view
An accessible data table should use the same filters, units, missing-value markers and ordering as the chart. If the chart displays a sampled or binned series, identify that fact and provide a route to full records when appropriate. Do not generate a table from SVG positions; derive both views from one data model. Export provenance should include the selection, filter and sort state so a shared screenshot and a CSV tell the same story. Test with only a keyboard, at narrow width, and with zoom before publication.
Worked contract
function nextChartPoint(currentIndex, pointCount, key) {
if (!Number.isInteger(pointCount) || pointCount < 1 ||
!Number.isInteger(currentIndex) || currentIndex < 0 ||
currentIndex >= pointCount) {
throw new RangeError("chart point state is invalid");
}
if (key === "ArrowRight" || key === "ArrowDown") {
return Math.min(currentIndex + 1, pointCount - 1);
}
if (key === "ArrowLeft" || key === "ArrowUp") {
return Math.max(currentIndex - 1, 0);
}
if (key === "Home") return 0;
if (key === "End") return pointCount - 1;
return currentIndex;
}
const visibleRecordIds = ["depot-47", "depot-59", "depot-83"];
let focusedIndex = 0;
focusedIndex = nextChartPoint(focusedIndex, visibleRecordIds.length, "End");
if (visibleRecordIds[focusedIndex] !== "depot-83") {
throw new Error("keyboard focus must follow chart order");
}
if (nextChartPoint(focusedIndex, visibleRecordIds.length, "ArrowRight") !== 2) {
throw new Error("focus must stop at the last record");
}Performance and operating cost
A key transition takes O(1) time and space; the displayed order and accessible table require O(N) record storage for N visible points. The pure function handles movement only. The browser component must connect it to focus, accessible names, announcement text and selection state, and must retain Tab exit. If a virtualized chart reorders records, map stable IDs to the new order before restoring focus. Treat the table as the source-aligned view, not as a decorative duplicate.
Common Mistakes
- Making hover-only tooltip content unavailable on focus and touch.
- Changing the selected cohort whenever a user merely moves focus.
- Adding every dense-series mark to the Tab order with no shortcut or data table.
- Restoring focus by pixel position after filter changes instead of stable record identity.
Validation drill
Audit a 188-point chart using only keyboard navigation. Verify focus visibility, Enter selection, Tab exit, a synchronized table and stable record identity after a filter change.
Read next
- Accessible charts: encode meaning without relying on color alone
- Interactive dashboards: recompute cohorts after linked filters
- Large chart series: reduce marks without erasing spikes
- Chart exports: carry the data, filters and render contract together
