Skip to content
  • System
  • Light
  • Dark
  • High contrast

ScatterChart

Complexity vs accessibility issues

Scatter chart, 5 points. 8 to 45. Values from 1 to 12.

246810121015202530354045Page complexityIssues found
import { ScatterChart } from '@eekodigital/raster';

<ScatterChart
  data={[
    { x: 12, y: 3, label: 'Homepage' },
    { x: 28, y: 7, label: 'Dashboard' },
  ]}
  xLabel="Page complexity"
  yLabel="Issues found"
  title="Complexity vs issues"
/>
Audit comparison

Scatter chart, 2 series, 6 points. 10 to 50. Values from 2 to 10.

2468101020304050ElementsViolations
Audit 1Audit 2
<ScatterChart
  series={[
    { name: 'Audit 1', data: [...], color: 'var(--demo-accent)' },
    { name: 'Audit 2', data: [...], color: 'var(--demo-good)' },
  ]}
  xLabel="Elements"
  yLabel="Violations"
  title="Audit comparison"
/>
  • A role="figure" named by the visible title and described by a generated summary (chart type, series and point counts, range).
  • The SVG is a role="group" with aria-roledescription="chart"; no graphics-* roles.
  • Named series are role="group"s. Each point is labelled {series}, {x}: {y}, 3 of 12 (with its label when given). With onSelect, selectedIndex or a click handler, marks are role="button" with aria-pressed; otherwise they’re static role="img".
  • Points use a different marker shape per series.
  • Arrow keys move in x order, so left and right match the drawing.
  • A visible Show data table button (aria-expanded) reveals a real table captioned Data for {title}, with th scope headers and values run through formatValue.
  • Escape (inside the chart only) clears the selection and announces it in a polite live region; it doesn’t close a surrounding dialog.
  • Animations stop under prefers-reduced-motion. In forced-colours mode marks use system colours, told apart by dash pattern and marker shape.
Key Action
← / → Previous / next mark
Home / End First / last mark
PageUp / PageDown Back / forward 10 marks
↑ / ↓ Previous / next series
Tab Leave the chart (one tab stop)
Enter / Space Toggle selection (interactive marks)
Escape Hide the tooltip and clear selection

See the Accessibility guide for the shared structure, the labels prop and screen-reader testing.

PropTypeDefaultDescription
dataScatterPoint[]—

Single series: { x, y, label? }.

seriesScatterSeries[]—

Named series: { name, data, color? }.

xLabelstring—X-axis title.
yLabelstring—Y-axis title.
grid“horizontal” | “vertical” | “both” | “none”“both”Grid lines.
formatValue(value: number) => stringIntl.NumberFormat

Formats values in ticks, marks and the table. Defaults to Intl.NumberFormat(labels.locale).

heightnumber240Plot height in px.
aspectRationumber—

Width ÷ height, instead of height. The plot box is sized in CSS either way, so server-rendered and hydrated layouts match.

onPointClick(point, seriesIndex, pointIndex) => void—Makes points buttons.
selectedIndex{ series, point } | null—Controlled selection.
onSelect(index | null) => void—Makes points buttons.
titlestring—Required. Visible title: names the figure and captions the data table.
hideTitlebooleanfalseHide the title visually. It still names the chart for assistive technology.
labelsPartial<ChartLabels>English

Generated strings and the number locale. See Accessibility.

dataTable“disclosure” | “visually-hidden”“disclosure”How the data table is offered.
exportRefRef<ChartExportHandle>—

SVG/PNG export. See Exporting charts.

classNamestring—Class on the figure.