Skip to content

Box Plot for Angular

AngularCharts

Accessible SVG box plot for comparing distributions per category: boxes from the lower to the upper quartile with a median line, whiskers, and outlier dots. Each datum is precomputed statistics or raw values (type-7 quantiles, Tukey whiskers at 1.5 IQR by default, or min/max). Several series are grouped side by side with a toggleable legend; each box is one keyboard-reachable mark whose name reads the five-number summary and the outlier count, and a data table lists every statistic and the outlier values.

  • Stats or raw valuesPass five-number summaries or raw values computed with spreadsheet quantiles.
  • Whisker rulesTukey whiskers with outliers or plain min and max whiskers.
  • Keyboard boxesOne tab stop; names read the five-number summary and outlier count.
  • Data table fallbackA summary and a table with every statistic and the outlier values.
  • Grouped seriesSeveral series side by side with legend toggles and optional textures.

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

import { Component } from '@angular/core';
import { AuiBoxPlot } from '@absoluteui/angular/box-plot';
import type { BoxPlotSeries } from '@absoluteui/components/box-plot';
@Component({
selector: 'app-latency',
imports: [AuiBoxPlot],
template: `<aui-box-plot label="Latency by region" [categories]="regions" [series]="series"></aui-box-plot>`,
})
export class LatencyComponent {
readonly regions = ['EU', 'US'];
readonly series: BoxPlotSeries[] = [{ id: 'prod', label: 'Prod', data: [[10, 12, 14, 16, 90], [8, 10, 11, 13, 15]] }];
}
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 { AuiBoxPlot } from '@absoluteui/angular/box-plot';

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

Class AuiBoxPlot; template reference #ref="auiBoxPlot".

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). Must not be blank.
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 (series and category counts, per-series lowest and highest median, hidden series).
valueFormat NumberFormatOptions Number format for statistics in box names, the tooltip, 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.
categories readonly string[] Required. Category labels, one per box group (text only).
series readonly BoxPlotSeries[] Required. Series: { id, label, data: BoxPlotDatum[], color?: 1-8 }, one datum per category. A datum is precomputed statistics { min, q1, median, q3, max, outliers? } (finite, min <= q1 <= median <= q3 <= max; min and max are the whisker ends), raw values number[] (non-finite values ignored), or null (no box).
categoryAxis { label?: string; } Category axis title; also the first data table column header (default “Category”).
valueAxis ValueAxisInput Value axis title, fixed domain (max > min; marks are clamped to it), and approximate tick count (2-20). includeZero is validated but has no effect on a box plot; the automatic domain spans every whisker and outlier.
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 values are category labels or indexes; 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 (toggle buttons) when there is more than one series.
dataTable ChartTableMode 'toggle' Data table fallback (one row per category and series: Minimum, Lower quartile, Median, Upper quartile, Maximum, Outliers): 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 (maximum, quartiles, median, minimum, outlier count).
patterns boolean false Texture fills on the boxes (and legend keys) of the second and later series so series 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.
whiskers BoxPlotWhiskers 'tukey' Whiskers computed from raw values: tukey (whiskers end at the most extreme values within 1.5 IQR of the quartiles; values beyond are outliers) or minmax (whiskers at the minimum and maximum, no outliers). Precomputed statistics are drawn as given.
locale string 'en-US' Number, list, and message locale.
direction Direction 'ltr' rtl mirrors the category axis and series order, moves the value axis to 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.
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.
(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 box plot as a named, described group (role=“group” with aria-roledescription “box plot”) of role=“img” boxes with roving focus; data table fallback (native table with every statistic and the outlier values).

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