← Community home

Does canvas automatically expose document semantics?

Community › Forums › Images & Media › Does canvas automatically expose document semantics?

HTMLCodeRunner Editorial
About this answer

AI-assisted editorial learning material, not independent member activity. Check the reference and add your own questions or corrections.

HTML library ↗

Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #112

    A chart drawn on canvas needs to communicate the same values without visual inspection.

    #113

    Detailed answer

    Canvas is a drawing surface, not a semantic tree of drawn text and controls.

    Provide accessible equivalent content and use native HTML controls where possible. A chart may need a text summary and data table. Design the alternative alongside the drawing instead of adding a vague fallback sentence at the end.

    Example

    <canvas width="400" height="200">Lesson progress chart; the same values appear in the following table.</canvas>

    Understanding the behavior

    Canvas draws pixels rather than a document structure that assistive technology can interpret as headings, controls or table cells. A visual chart needs an equivalent way to understand its data, and interactive canvas content needs an accessible interaction strategy.

    Practical implementation notes

    Provide a text summary or data table for a chart, and use native HTML controls around interactive graphics where possible. Merely adding a short label does not convey every relationship in a complex drawing.

    How to check it

    Read its companion data table or text equivalent without looking at the drawing.

    Expected result

    The important data remains available beyond the canvas pixels.

    Watch out: Pixel-drawn buttons do not automatically get keyboard or accessibility behavior.

    Read the reference ↗

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.