Chart accessibility and localization

What the chart says to assistive technology and does on its own: the image and its data table, names on every mark, the keyboard model, the live region, reduced motion, forced colors, the axe audit, and localeText for every string it renders.

The examples on this page import from @svgrid/grid:

<script lang="ts">
  import { SvGrid, SvGridChart } from '@svgrid/grid'
</script>

Accessibility

What the chart says to assistive technology, and what it does on its own:

Localization

localeText translates the chart's own strings: toolbar buttons and their titles, the context menu, the legend's hints and overflow toggle, the empty state, the donut's Total, and what it says to assistive technology (the image label, the data table caption, the live region, the dense chart's hint). It is a partial map over ChartMessages; unset keys stay English. Placeholders in braces are filled in: {type} in the image label, {series} / {value} / {category} in the live region, {n} in the overflow toggle. resolveChartMessages and chartMessage are exported for a host that draws its own chrome, and charting.localeText hands the same map to every chart the grid panel draws.

<script lang="ts">
  import { SvChart, type ChartSpec } from '@svgrid/grid'

  const spec: ChartSpec = {
    type: 'bar',
    categories: ['Q1', 'Q2', 'Q3', 'Q4'],
    series: [{ label: 'Umsatz', values: [120, 140, 90, 180] }, { label: 'Kosten', values: [80, 95, 70, 110] }],
    title: 'Umsatz und Kosten',
  }
</script>

<SvChart
  {spec}
  toolbar
  zoomable
  localeText={{
    chartLabel: '{type}-Diagramm',
    dataTable: 'Daten des {type}-Diagramms',
    png: 'PNG', downloadPng: 'Als PNG herunterladen',
    svg: 'SVG', downloadSvg: 'Als SVG herunterladen',
    pdf: 'PDF', downloadPdf: 'Als PDF herunterladen',
    print: 'Drucken', printTitle: 'Diagramm drucken',
    copy: 'Kopieren', copied: '✓ Kopiert', copyTitle: 'Als Bild kopieren',
    resetZoom: 'Zoom zurücksetzen', resetZoomTitle: 'Zoom zurücksetzen (oder Doppelklick)',
    hideSeries: 'Ausblenden', showSeries: 'Einblenden', isolateHint: 'Doppelklick isoliert',
    seriesAtCategory: '{series}: {value} bei {category}',
  }}
/>

The grid panel's strings

The panel and the builder are grid chrome, so their strings live on the grid's own map, localization.text (a Partial<GridMessages>), next to the pager and the filter operators. The chart panel keys all start with chart and load with the panel, not with every grid:

Keys What they label
chartPanelTitle, chartClearFilter, chartExport*, chartAdd, chartSave*, chartMaximize, chartRestore, chartDock*, chartPopOut*, chartClose, chartResize*, chartTabs, chartRemove*, chartEmpty* The head, its buttons, the export menu, the tab strip, the empty states
chartAi* The AI row: button, placeholder, Chart it, Explain, its errors
chartBuild*, chartLinkBack, chartUnlink, chartLinkedTitle, chartUnlinkedTitle The Build button and the link toggle
chartType, chartDate, chartGroupBy, chartSplitBy, chartValue, chartX, chartY, chartLow, chartHigh, chartOpen, chartClosePrice, chartVolume, chartMetric, chartTarget, chartAggregate, chartFormat*, chartBins*, chartShape*, chartCandles*, chartBucket*, chartColours, chartNone The pickers and their options
chartReduce*, chartPalette*, chartInd*, chartType<Name>, chartGroup<Name> Aggregates, palettes, indicator chips (label and title), the thirty type names and their six groups
chartStacked, chartStacked100, chartHorizontal, chartDonut, chartLabels, chartLogScale, chartDateAxis (and their *Title hints) The switches
chartIssue* Why the chosen type cannot draw yet
chartBuilder*, chartLegend*, chartLabels<Placement> The builder: its title and tabs, every Format field, the series table, the style fieldset

{title}, {time} and {series} placeholders are filled in where a message has them. resolveChartPanelMessages and chartPanelMessage are exported, and defaultChartPanelMessages is the full English map to copy from. The grid panel page has a German panel to try.

More examples

Color-blind-safe pattern fills

patternFallback: true layers a texture (stripe / crosshatch / dots / diagonal) on every series so two series with similar hues still read as distinct in grayscale or for readers with color-vision deficiency. Works on bars and area stacks.

Open the live example: Color-blind-safe pattern fills (Charts)

Axes, titles and styling

Open the live example: Axes, titles and styling (Charts)

Every chart type

Open the live example: Every chart type (Charts)

See also

Live examples

  • Color-blind-safe pattern fills - patternFallback: true layers a texture (stripe / crosshatch / dots / diagonal) on every series so two series with similar hues still read as distinct in grayscale or for readers with color-vision deficiency. Works on bars and area stacks.
  • Axes, titles and styling - The chart hands the decisions back: a numeric x axis that spreads payload sizes the way the numbers do, pinned domains with a fixed tick interval and a formatter per axis, grid lines on or off, a shaded budget band, a vertical reference line, per-point markers and colours, a stepped dashed series on the right axis, a title / subtitle / caption, a legend on any side, and a tooltip snippet in single-series mode. Below it, 50,000 monitoring readings decimated to one point per pixel with LTTB or min / max - toggle it off to see the cost.
  • Every chart type - Every chart type from one dataset, thirty live thumbnails: bar, horizontal bar, line, area, lollipop, dumbbell, range bar, range area, pareto, radial column, radial bar, nightingale, pie / donut, tree map, sunburst, funnel, waterfall, sankey, chord, radar, heat map, scatter, box plot, histogram, gauge, bullet, calendar, stream, candlestick and OHLC. Click a card for the full-size chart and its variants: classic / hollow / Heikin-Ashi candles, funnel / pyramid / cone, wiggle / silhouette streams, stacking. Every spec is built with the helpers the grid chart panel uses.

Related articles

  • Choosing the Most Accessible Svelte Data Grid - A practical guide to testing data grid accessibility - ARIA roles, keyboard navigation, focus management under virtualization, and screen-reader behavior - so you can verify claims yourself.
  • Cell Tooltips Done Right in a Data Grid - Tooltips in a data grid are either cheap and effective or an accessibility and performance trap. Here is how to build them correctly in SvGrid.
  • Accessibility from the Ground Up - How SvGrid bakes WAI-ARIA roles and keyboard navigation into the core - not as a post-launch checkbox, but as a design constraint that shaped every feature.