Apache ECharts includes built-in accessibility features through ARIA (Accessible Rich Internet Applications) support. The ARIA module automatically generates descriptive labels for screen readers and provides decal patterns for users with color vision deficiencies.
From src/visual/aria.ts:31-38, the default ARIA configuration is:
var option = { aria: { enabled: true, // Decal patterns for accessibility decal: { show: false }, // Label configuration for screen readers label: { enabled: true, description: '', // Custom description general: { withTitle: 'This is a chart about "{title}"', withoutTitle: 'This is a chart' }, series: { maxCount: 10, // Max series to describe single: { prefix: '', withName: 'The chart type is {seriesType}, representing {seriesName}.', withoutName: 'The chart type is {seriesType}.' }, multiple: { prefix: 'It consists of {seriesCount} series.', withName: 'The {seriesId} series is a {seriesType}, representing {seriesName}.', withoutName: 'The {seriesId} series is a {seriesType}.', separator: { middle: ';', end: '.' } } }, data: { maxCount: 10, // Max data points to describe per series allData: 'The data is as follows: ', partialData: 'The first {displayCnt} items are: ', withName: '{name} is {value}', withoutName: '{value}', separator: { middle: ',', end: '' } } } }};
Provide a custom description to override auto-generation:
var option = { aria: { enabled: true, label: { description: 'A bar chart showing monthly sales data for 2024. Sales increased from $10,000 in January to $50,000 in December, with a notable spike in June reaching $75,000.' } }, title: { text: 'Monthly Sales 2024' }, series: [{ type: 'bar', data: [10000, 15000, 20000, 25000, 30000, 75000, 40000, 45000, 50000, 45000, 48000, 50000] }]};
For a chart with title and series, the auto-generated label might be:
var option = { aria: { enabled: true }, title: { text: 'Sales Statistics' }, series: [ { name: 'Product A', type: 'bar', data: [120, 200, 150, 80, 70, 110] }, { name: 'Product B', type: 'bar', data: [90, 150, 120, 100, 80, 95] } ]};// Generated aria-label (from src/visual/aria.ts:174-247):// "This is a chart about Sales Statistics. It consists of 2 series.// The 0 series is a bar chart, representing Product A. The data is as follows:// 120, 200, 150, 80, 70, 110.// The 1 series is a bar chart, representing Product B. The data is as follows:// 90, 150, 120, 100, 80, 95."
// From src/component/aria/install.ts:24-26export function install(registers: EChartsExtensionInstallRegisters) { registers.registerPreprocessor(ariaPreprocessor); registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual);}