liveBook · Manning

Aria-labelledby

As explained in Everyday Data Visualization

A WAI-ARIA attribute that supplies an accessible name by referencing the identifiers of visible labeling elements.

aria-labelledby gives an element an accessible name by pointing to other objects’ id attributes. Use it when the label is already visible elsewhere on the screen. section 7.3.4

Use the two ARIA naming options deliberately:

  • Choose aria-labelledby when visible text already labels the element; choose aria-label when that text is not displayed elsewhere. section 7.3.4
  • Keep labels concise—about three words at most—and make each chart element’s label accurate and meaningful. section 7.3.4
  • Use the attribute to generate labels dynamically when code runs, including labels for individual bars in a graph. section 7.3.4
  • If the tool cannot add ARIA labels, provide descriptive captions or other meaningful text so screen readers can convey the visual’s main takeaways. section 7.3.4
Figure 7.13 Using the graph from the previous two figures, this is what ARIA labels could look like for those bars. Each bar would have its own corresponding label, all of which are shown together in the yellow box to the right.
07-13

Inspect how each bar in a graph can receive its own concise ARIA label, with the labels shown together for comparison. section 7.3.4

How Everyday Data Visualization covers it

How deep it goes
Defines the distinction from aria-label and gives dynamic chart examples, but stops short of detailed markup syntax.
Examples
Uses individually labeled bars in a graph and descriptive text as a fallback when visualization tools limit ARIA support.
What it assumes
Assumes basic coding for implementation while explaining the label distinction in approachable terms.
What you can do after
Apply it via WAI-ARIA to provide concise, dynamically generated accessible names for visual elements.
How it connects
Connects aria-label, accessible names, screen readers, alt text, captions, and WAI-ARIA.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Everyday Data Visualization. The section links point to the parts of the book it draws on.