Charts - Accessibility

Configure screen reader support, ARIA labels, keyboard navigation, and focus indicators for chart data.

#Usage

import { ChartAccessibility, ChartSvg } from '@primeui/vue-chart';
<ChartSvg>
    <!-- series and axes -->
    <ChartAccessibility />
</ChartSvg>

Charts auto-generate basic screen reader descriptions from data by default. Add ChartAccessibility to take full control: override descriptions, configure keyboard navigation between data points, and style focus indicators.

#Basic

Charts auto-generate screen reader descriptions from data when no ChartAccessibility component is mounted. Add ChartAccessibility to override descriptions, adjust verbosity, configure keyboard navigation, and style focus indicators.

Loading Demo...

#Color Vision

Color alone can be difficult to distinguish for viewers with color vision deficiency. Set patterns to true to make every series distinguishable by texture in addition to color. Filled marks receive a cycled texture pattern, line series receive distinct dash styles, and heatmaps switch to a colorblind-safe sequential scale. An explicit color, gradient, or pattern is always respected, so patterns fills the default without overriding a deliberate choice.

<ChartSvg>
    <!-- series -->
    <ChartAccessibility patterns />
</ChartSvg>

Patterns travel through the same fill pipeline as solid colors, so the legend and tooltip show the pattern, and the SVG and Canvas renderers produce matching output.

Loading Demo...

A pattern can also be set directly, per series or per item, without enabling the full auto-mode. A PatternFill is a FillValue, accepted anywhere a color is, so assigning one to a mark's color sets the texture.

import type { PatternFill } from '@primeui/chart-types';

const color: PatternFill = { pattern: 'diagonal', color: '#3B82F6' };

color is the solid fill of the shape. The texture is knocked out of that fill as transparent grooves, so the mark reads as a filled color carrying a distinguishing texture rather than sparse lines on an empty background. Set backgroundColor for an opaque two-tone pattern, where the texture is painted in the second color instead of left transparent. The built-in patterns are dots, lines-horizontal, lines-vertical, diagonal, diagonal-reverse, grid, crosshatch, and zigzag. Set size to change the tile size and strokeWidth to change the texture line weight.

#Custom Description

Set description to provide a custom screen reader summary of the chart. When omitted the chart auto-generates a description from the data, series names, and chart type. Set typeDescription to override the chart type label when the auto-detected description is too broad, or for treemap and heatmap charts where the auto-generated label is the raw internal identifier. Set headingLevel to control the heading element used for the visually hidden screen reader section. The default is 'h4'.

Loading Demo...

#Point Descriptions

Each data point gets an auto-generated aria-label describing its category, value, and series. Set pointDescriptionFormatter to customize the text. Set seriesDescriptionFormatter to customize the series-level description. Set pointDescriptionThreshold to disable per-point labels on large datasets; when the point count exceeds the threshold, only the series-level description is announced. These descriptions apply to the SVG renderer; canvas charts expose the same data through the screen-reader data table instead.

Loading Demo...

#Screen Reader Data Table

Charts also render a visually hidden data table for assistive technology. The table uses the chart's registered data model instead of the rendered SVG or Canvas marks, so screen readers can inspect the underlying values by row and column.

Set dataTableMaxRows to cap how many rows are rendered in the hidden table. The default cap is 200; when more rows exist, a summary row reports how many rows were omitted. Set dataTableCellFormatter to format each rendered table cell. The formatter also applies to CSV export, so downloaded values can match the accessible table text.

<ChartAccessibility description="Quarterly revenue by region, comparing enterprise and commercial segments." :dataTableMaxRows="50" :dataTableCellFormatter="formatAccessibilityCell" />
function formatAccessibilityCell({ value, column, isNumeric }) {
    if (isNumeric && column === 'Value') {
        return new Intl.NumberFormat('en-US', {
            style: 'currency',
            currency: 'USD',
            maximumFractionDigits: 0
        }).format(Number(value));
    }

    return String(value);
}

CSV export uses the same data-table columns and formatter, but exports every chart row instead of applying the screen reader row cap.

#Keyboard Navigation

Keyboard navigation is enabled by default when ChartAccessibility is mounted. Arrow keys move between data points within a series; Tab moves between series. Set keyboardNavigation.enabled to false to disable it.

Series-level navigation options live under keyboardNavigation.seriesNavigation. Set mode to 'serialize' to navigate all points as a flat list across all series instead of per-series. Set skipNullPoints to false to allow landing on null data points. Set rememberPointFocus to true to restore the last focused point index when switching back to a series. Set pointNavigationEnabledThreshold to disable per-point navigation when a series exceeds a given size. Set keyboardNavigation.wrapAround to false to stop at the last point instead of cycling back to the first.

Loading Demo...

#Focus Indicator

The focused data point shows a visible focus ring, configured under keyboardNavigation.focusBorder. Set style.color, style.width, style.lineStyle, and style.borderRadius to customize its appearance. Set margin to control the gap between the focus ring and the element. Set hideBrowserFocusOutline to true (default) to suppress the browser's native focus outline. Set enabled to false to remove the custom ring entirely without disabling keyboard navigation.

Loading Demo...

#Landmark Verbosity

Set landmarkVerbosity to control how many ARIA landmarks are added to the chart. 'all' (default) adds a landmark per series for fine-grained screen reader navigation. 'chart' adds a single chart-level landmark. 'disabled' adds none, which is appropriate when the chart sits inside an already-labeled region.

Loading Demo...

#Disabling Accessibility

Set enabled to false to disable all accessibility features. Only do this when the chart is purely decorative and a text alternative is provided elsewhere on the page.

#API

#ChartAccessibility

PropTypeDefaultDescription
enabledbooleantrueEnable or disable all accessibility features
patternsbooleanfalseApply colorblind-safe encodings: cycled texture patterns on filled marks, distinct dashes on lines, and a colorblind-safe scale on heatmaps
descriptionstringauto-generatedCustom chart description for screen readers
typeDescriptionstringauto-detectedOverride the chart type label, e.g. 'Grouped bar chart'
headingLevel'h2' | 'h3' | 'h4' | 'h5' | 'h6''h4'Heading level for the screen reader info section
pointDescriptionThresholdnumber200Disable per-point aria-labels when a series exceeds this point count
dataTableMaxRowsnumber200Maximum rows rendered in the visually hidden screen reader data table before adding a truncation summary
dataTableCellFormatter(context: DataTableCellContext) => string-Format each screen reader data-table cell. The same formatter is used by CSV export
pointDescriptionFormatter(context: PointDescriptionContext) => stringautoCustom point description formatter
seriesDescriptionFormatter(context: SeriesDescriptionContext) => stringautoCustom series description formatter
landmarkVerbosity'all' | 'chart' | 'disabled''all'ARIA landmark verbosity. 'all' adds per-series landmarks, 'chart' adds chart-level only, 'disabled' adds none
keyboardNavigationKeyboardNavigationConfig-Keyboard navigation configuration

#PatternFill

Assignable to a mark's color (or a per-item color accessor) anywhere a solid color is accepted.

FieldTypeDefaultDescription
patternPatternName-Built-in pattern: dots, lines-horizontal, lines-vertical, diagonal, diagonal-reverse, grid, crosshatch, zigzag
colorstring-Solid fill color of the shape
backgroundColorstringtransparentTexture color. Transparent knocks the texture out as grooves; set it for a two-tone pattern
sizenumberper-patternTile size in pixels
strokeWidthnumberper-patternTexture line weight in pixels

#KeyboardNavigationConfig

PropTypeDefaultDescription
enabledbooleantrueEnable keyboard navigation between data points
wrapAroundbooleantrueCycle from last element back to first when navigating past the end

#KeyboardNavigationConfig: Focus Border

Set via keyboardNavigation.focusBorder.

PropTypeDefaultDescription
enabledbooleantrueShow a focus ring around the focused element
hideBrowserFocusOutlinebooleantrueHide the browser's native focus outline
marginnumber2Padding around the focused element in pixels
style.colorstring'#000'Focus ring color
style.widthnumber2Focus ring width in pixels
style.lineStyle'solid' | 'dashed' | 'dotted''dashed'Focus ring line style
style.borderRadiusnumber3Focus ring corner radius in pixels

#KeyboardNavigationConfig: Series Navigation

Set via keyboardNavigation.seriesNavigation.

PropTypeDefaultDescription
mode'normal' | 'serialize''normal'normal navigates within one series at a time. serialize navigates all points as a flat list across all series
pointNavigationEnabledThresholdnumber-Disable per-point navigation when a series exceeds this point count
rememberPointFocusbooleanfalseRemember the last focused point index when switching between series
skipNullPointsbooleantrueSkip null or empty points during navigation

#PointDescriptionContext

Passed to pointDescriptionFormatter.

FieldTypeDescription
categorystringCategory label, e.g. 'January'
valuenumberData value
seriesNamestringSeries name
indexnumberIndex within the series
totalnumber | undefinedSum of all values. Pie charts only
percentagenumber | undefinedPercentage of total. Pie charts only

#SeriesDescriptionContext

Passed to seriesDescriptionFormatter.

FieldTypeDescription
namestringSeries name
typestringChart type identifier
pointCountnumberNumber of data points in the series

#DataTableCellContext

Passed to dataTableCellFormatter.

FieldTypeDescription
valuestring | numberRaw cell value before formatting
columnstringColumn header, e.g. 'Category', 'Value', 'Open', or 'Close'
columnIndexnumberZero-based column index within the row
rowIndexnumberZero-based row index within the data-table body
isNumericbooleantrue when the underlying cell value is numeric instead of a label