Chart accessibility.

Build charts that convey meaning beyond color and pointer interaction.

Chart meaning and alternative data

#

Include the measurement and unit in the chart title, and explain key findings in the body. You can also provide numbers through an external HTML table or the shared facade's data table.

<figure aria-labelledby="trend-title" aria-describedby="trend-description">
  <figcaption id="trend-title">Monthly visitors · Thousands</figcaption>
  <p id="trend-description">Increased from 24 in January to 35 in March.</p>
  <sy-chart id="trend" type="line" aria-label="Monthly visitor trend"></sy-chart>
  <button id="show-data" type="button">Open data table</button>
</figure>
<script type="module">
  await customElements.whenDefined('sy-chart');
  const chart = document.querySelector('#trend');
  chart.series = [{ name: 'Visitors', values: [24, 29, 35] }];
  chart.xAxis = { kind: 'category', categories: ['Jan', 'Feb', 'Mar'] };
  document.querySelector('#show-data').addEventListener('click', () => chart.showDataTable());
</script>