Skip to content

Scatter Chart for Angular

AngularCharts

Accessible SVG scatter plot (and bubble chart when points have a size) of one or more series of (x, y) points on linear axes, with a toggleable legend, keyboard-reachable points in x order with tooltips, optional crosshair, optional zoom and pan along x or both axes, a generated summary, and a data table fallback. Series differ by color and marker shape, never by color alone.

  • Scatter or bubblePlot x and y points; a size per point turns it into a bubble chart.
  • Zoom and panZoom along x or both axes, with an optional crosshair through the active point.
  • Keyboard pointsOne tab stop; points ordered by x, Up and Down switch series.
  • Data table fallbackA generated summary of ranges and a table with the exact values.
  • Not color aloneSeries differ by color and marker shape.

Behavior, design tokens, and limitations are described on the Scatter Chart page; this page covers the Angular API.

import { Component } from '@angular/core';
import { AuiScatterChart } from '@absoluteui/angular/scatter-chart';
import type { ScatterChartSeries, ScatterChartZoomDetail } from '@absoluteui/components/scatter-chart';
@Component({
selector: 'app-correlation',
imports: [AuiScatterChart],
template: `<aui-scatter-chart label="Height and weight" [series]="series" [zoom]="'xy'" [crosshair]="true" (zoomed)="onZoom($event)"></aui-scatter-chart>`,
})
export class CorrelationComponent {
readonly series: ScatterChartSeries[] = [{ id: 'a', label: 'Group A', points: [{ x: 160, y: 55 }, { x: 175, y: 72 }] }];
zoomed = false;
onZoom(detail: ScatterChartZoomDetail): void {
this.zoomed = detail.x !== null || detail.y !== null;
}
}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiScatterChart } from '@absoluteui/angular/scatter-chart';

Defaults for every instance: provideAbsoluteUIConfig({ components: { scatterChart: { ... } } }) (see Configuration).

Class AuiScatterChart; template reference #ref="auiScatterChart".

Server rendering: Renders on the server; the browser re-creates it after hydration.

Input Type Default Description
label string Required. Chart title: visible text and the accessible name of the plot (aria-labelledby).
hideLabel boolean false Visually hide the title; it stays the accessible name.
description string Visible description below the title, also referenced by aria-describedby (text only).
summary string Replaces the generated accessible summary (aria-describedby).
valueFormat NumberFormatOptions Number format for values in tooltips, labels, the data table, the summary, and axis ticks (ticks use fixed fraction digits).
formatValue (value: number) => string Custom value text; overrides valueFormat everywhere except axis ticks.
series readonly ScatterChartSeries[] Required. Series: { id, label, points: { x: number; y: number; size?: number; label?: string }[], color?: 1-8 }. Ids are unique and non-empty. Points with a non-finite x or y are skipped. Any point with a size makes the chart a bubble chart.
xAxis ScatterChartAxis X axis title, fixed domain (min < max), approximate tick count (2-20), and zero inclusion (default false). The title also names x in point labels, tooltips, and the table (default “X axis”).
yAxis ScatterChartAxis Y axis title, fixed domain, tick count, and zero inclusion (default false). The title also names y (default “Y axis”).
sizeLabel string 'Size' Name of the size dimension in bubble labels, tooltips, and the table.
sizeRange readonly [number, number] '4,24' Bubble radius in CSS px for the smallest and largest size (each 1-100, min <= max). Area is proportional to size.
xFormat NumberFormatOptions Number format of x values (ticks, labels, tooltips, table, summary). Default: valueFormat.
zoom ChartZoomMode 'none' Zoom and pan along x or both axes: a Zoom toolbar (Zoom in, Zoom out, Reset zoom), +/= and - and 0 keys on a focused point, Ctrl/Cmd + wheel, drag to pan a zoomed chart, Shift + drag to select a range. Turning it off resets the window.
annotations readonly ChartAnnotation[] Reference lines ({ type: ‘line’, axis: ‘x’ | ‘y’, value, label?, tone? }) and bands ({ type: ‘band’, axis, from, to, label?, tone? }); tone: ‘neutral’ | ‘info’ | ‘success’ | ‘warning’ | ‘danger’. x and y values are numbers. Drawn under the marks (aria-hidden); listed in the accessible summary.
theme ChartTheme Look and feel: { palette?: string[] (1-8 CSS colors for slots 1-8); fontFamily?; fontSize? (8-32 px); textColor?; gridLines?: boolean; gridColor?; gridDash? (“4 2” or “none”); axisColor?; lineWidth? (0.5-12 px); markerSize? (1-20 px); cornerRadius?, barRadius?, cellRadius?, sliceRadius?, boxRadius? (0-50 px); swatchRadius? (0-8 px); tooltipRadius?, controlRadius? (0-50 px); lineJoin?: ‘round’ | ‘miter’ | ‘bevel’; areaOpacity? (0-1); gradient?: boolean; valueLabelColor?; tooltip?: { background?, color?, borderColor? }; legendPosition?: ‘top’ | ‘bottom’ | ‘start’ | ‘end’; animation?: boolean | { duration?: number (0-5000 ms) } }. Applied as –aui-chart-* custom properties and classes on the host through the CSSOM (CSP-safe); colors are validated with CSS.supports(‘color’). Animation is opt-in and never runs with prefers-reduced-motion: reduce or [data-aui-animation=‘none’].
renderTooltip ChartTooltipRenderer Custom tooltip content as DOM nodes (never HTML strings). context: { title, rows: { label, value, seriesId }[], column, row, source: “pointer” | “focus” | “sync” }. Return null for the default tooltip. The tooltip stays aria-hidden; the focused mark keeps its accessible label.
syncGroup string Synchronized crosshair: charts with the same group show the crosshair, highlight, and tooltip at the same column (category or x index) when one of them is hovered or focused. Focus never moves between charts. Use charts that share their categories or x values.
legend ChartLegendMode 'auto' auto: legend when there is more than one series. Entries are toggle buttons.
dataTable ChartTableMode 'toggle' Data table fallback with the exact data: behind a Show data table button (built on first open), always visible, visually hidden (screen readers only), or none.
tooltip boolean true Tooltip on pointer hover and keyboard focus.
patterns boolean false Texture fills (and dash patterns for lines) so marks never differ by color alone (always on in forced colors).
height number '300' Plot height in CSS px (integer 120-2000); the width follows the container.
crosshair boolean false Crosshair lines (vertical and horizontal, aria-hidden) through the hovered or focused point.
locale string 'en-US' Number and message locale.
direction Direction 'ltr' rtl mirrors the x axis, puts the value axis on the right, and swaps ArrowLeft/ArrowRight.
Model Type Change output Description
[(hiddenSeries)] readonly string[] (hiddenSeriesChange) Ids of series hidden initially; update() replaces the hidden set.
[(zoomRange)] ChartZoomRange | null (zoomRangeChange) Visible x window { from, to } in data units; null shows everything. Clamped to the data (minimum span 1/50 of the extent). Applied without an aui-zoom event; use with zoom enabled.
[(zoomRangeY)] ChartZoomRange | null (zoomRangeYChange) Visible y window with zoom: “xy” (ignored otherwise); null shows everything.
Output Payload Description
(seriesToggled) ChartSeriesToggleDetail The user toggled a legend entry (pointer or keyboard). Not emitted for update() or setSeriesVisible(). Re-emits aui-series-toggle.
(zoomed) ChartZoomDetail The user changed the visible window (toolbar, keys, Ctrl/Cmd + wheel, drag pan, Shift + drag selection). x and y are null when that axis shows everything (y is always null with zoom: “x”). Not emitted for the zoom range options or when the window does not change. Re-emits aui-zoom.
(pointClicked) ChartPointClickDetail A data mark was activated: pointer click or tap, or Enter / Space on the focused mark. label is the category, x value, or item; value is the formatted value text. Keyboard navigation is unchanged. Re-emits aui-point-click.

Call them through a viewChild query or a template reference.

Method Description
setSeriesVisible(id: string, visible: boolean): void Show or hide a series programmatically; emits no event.

Pattern: SVG chart as a named, described group (role=“group” with aria-roledescription) of role=“img” data marks with roving focus; data table fallback (native table). Follows the WAI Complex Images tutorial (short name plus long description) and the roving tabindex technique of WAI-ARIA APG.

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Scatter Chart: Accessibility and performance.