Skip to main content

A11y helpers

labelChart​

Gives a chart's svg the role, aria-label and <desc> that screen readers announce. The name is an attribute, not a <title>: browsers show an svg's <title> as a tooltip when the pointer rests on the chart. Run on every render: it reuses the <desc> it made the first time and only updates its text, so its id, and the attribute that points at it, stay stable.

Kind: global constant