Candlestick Chart
Introduction
Section titled “Introduction”Accessible SVG candlestick chart: daily open-high-low-close prices as candles (rising hollow, falling filled, so direction never depends on color alone) or OHLC bars, an optional volume pane, and simple moving-average overlays. The time axis is a day axis; with a business calendar it counts trading days only, skipping weekends and holidays. Crosshair, zoom and pan, keyboard navigation along the sessions, tooltips, a generated summary, and the data table are built in.
- Trading daysWith a business calendar, weekends and holidays take no space on the axis.
- Direction by shapeRising candles are hollow and falling ones filled, so color is never the only cue.
- Volume and averagesAn optional volume pane and up to four moving averages with legend toggles.
- Zoom and crosshairToolbar, keyboard, wheel, and drag zoom with a crosshair on the focused session.
Use it for
- Daily price movements of a security, commodity, or index, with the range of each session visible.
- Comparing closes against moving averages and volume.
Use something else for
- Intraday (sub-daily) data: dates are PlainDate values, one session per day.
- A single value per day: use Line Chart.
- Many securities at once: use Line Chart with one series each.
Anatomy
<div class="aui-chart aui-candlestick-chart [aui-chart--zoomable aui-chart--zoomed]"> <div class="aui-chart__header">title, description, <div class="aui-chart__toolbar">zoom buttons</div></div> <ul class="aui-chart__legend">moving-average toggle buttons</ul> <div class="aui-chart__body"> <svg class="aui-chart__svg" role="group" aria-roledescription="candlestick chart" aria-labelledby="T" aria-describedby="S"> <g class="aui-chart__grid" aria-hidden="true"/> <g class="aui-chart__axis" aria-hidden="true"/> <g class="aui-candlestick-chart__volume" aria-hidden="true">bars</g> <g class="aui-candlestick-chart__candles"><path class="aui-candlestick-chart__candle aui-candlestick-chart__candle--up aui-chart__mark" role="img" aria-label="Mar 2, 2026: open 100, ..." tabindex="0"/>...</g> <g class="aui-candlestick-chart__averages" aria-hidden="true">lines</g> </svg> <div class="aui-chart__tooltip" aria-hidden="true" hidden/> </div> <p class="aui-chart__summary" hidden/> <div class="aui-chart__data">Show data table, table</div></div>Live example
Section titled “Live example”Use the bar above each frame to switch theme, density, direction, and locale.
Candlestick Chart in the Advanced visualizations showcase
Section titled “Candlestick Chart in the Advanced visualizations showcase”The part of the Advanced visualizations showcase that uses Candlestick Chart. Change its options, use it with the keyboard, and watch the event log; the link in the frame opens the full showcase. The bar above the frame switches theme, density, direction, and locale.
Showcase source
// Advanced visualizations showcase: an illustrative share price as candles on a trading-day axis, team collaboration as a network// graph, and absences in a calendar heatmap with holidays. All data is small, inline, and// made up. Style and animation are switchable; events are logged.import { plainDate, type PlainDate } from '@absoluteui/core';import { createBusinessCalendar } from '@absoluteui/components/business-calendar';import { CalendarHeatmap } from '@absoluteui/components/calendar-heatmap';import { CandlestickChart, type CandlestickPoint } from '@absoluteui/components/candlestick-chart';import { NetworkGraph } from '@absoluteui/components/network-graph';import { action, chartControls, chartLook, choice, createShowcase, hostIn, section, toggle } from './kit.js';
const sc = createShowcase({ title: 'Advanced visualizations', description: 'Three special charts on the same chart layer: prices, networks, and calendars. Each one works with the keyboard, has a data table, and follows the theme.',});
const calendar = createBusinessCalendar({ holidays: [ { date: plainDate(2026, 1, 1), name: 'New Year' }, { date: plainDate(2026, 4, 3), name: 'Good Friday' }, { date: plainDate(2026, 4, 6), name: 'Easter Monday' }, { date: plainDate(2026, 5, 1), name: 'Labour Day' }, ],});
// 1. Share price on trading days (weekends and the holidays above are skipped).const s2 = section(sc, 'Share price', ['candlestick-chart']);const sessions: CandlestickPoint[] = [];{ let date: PlainDate = plainDate(2026, 3, 2); let price = 48; for (let i = 0; i < 90; i++) { const open = price; const close = Math.round((open * (1 + Math.sin(i / 5) * 0.015 + Math.cos(i / 2) * 0.01 + 0.002)) * 100) / 100; const spread = open * 0.012; sessions.push({ date, open, close, high: Math.round((Math.max(open, close) + spread) * 100) / 100, low: Math.round((Math.min(open, close) - spread) * 100) / 100, volume: 40000 + ((i * 7919) % 30000) }); price = close; date = calendar.addWorkingDays(date, 1); }}const candles = CandlestickChart.create(hostIn(s2), { label: 'Share price (illustrative)', description: 'Trading days only: weekends and public holidays take no space. Zoom with the toolbar, + and -, or Ctrl and the wheel.', data: sessions, businessCalendar: calendar, movingAverages: [{ period: 10 }, { period: 30, style: { dash: 'dashed' } }], valueFormat: { style: 'currency', currency: 'EUR' }, zoom: true, zoomRange: { from: 40, to: 89 }, height: 340,});
const grid = hostIn(sc.stage);grid.className = 'sc-grid';const networkSection = section(sc, 'Team collaboration', ['network-graph']);const absenceSection = section(sc, 'Absences', ['calendar-heatmap']);grid.append(networkSection, absenceSection);
// 2. Team collaboration.const network = NetworkGraph.create(hostIn(networkSection), { label: 'Team collaboration', description: 'Drag a person to pin them, or press Shift and an arrow key. Arrow keys move to a connected person.', nodes: [ { id: 'ana', label: 'Ana', group: 'design', value: 6 }, { id: 'ben', label: 'Ben', group: 'eng', value: 9 }, { id: 'chi', label: 'Chi', group: 'eng', value: 7 }, { id: 'dev', label: 'Dev', group: 'product', value: 8 }, { id: 'eli', label: 'Eli', group: 'eng', value: 4 }, { id: 'fay', label: 'Fay', group: 'design', value: 3 }, { id: 'gus', label: 'Gus', group: 'data', value: 5 }, { id: 'hal', label: 'Hal', group: 'data', value: 2 }, { id: 'ivy', label: 'Ivy', group: 'product', value: 4 }, { id: 'jon', label: 'Jon' }, ], edges: [ { source: 'ana', target: 'ben', weight: 4 }, { source: 'ana', target: 'fay', weight: 3 }, { source: 'ben', target: 'chi', weight: 6 }, { source: 'ben', target: 'eli', weight: 2 }, { source: 'chi', target: 'dev', weight: 3 }, { source: 'dev', target: 'ana', weight: 2 }, { source: 'dev', target: 'ivy', weight: 4 }, { source: 'gus', target: 'chi', weight: 2 }, { source: 'gus', target: 'hal', weight: 3 }, { source: 'ivy', target: 'gus' }, ], groups: [ { id: 'design', label: 'Design' }, { id: 'eng', label: 'Engineering' }, { id: 'product', label: 'Product' }, { id: 'data', label: 'Data' }, ], height: 340,});
// 3. Absences over the first half of the year.const absences = CalendarHeatmap.create(hostIn(absenceSection), { label: 'Absences, January to June', description: 'Dashed squares are weekends; dots are public holidays.', from: plainDate(2026, 1, 1), to: plainDate(2026, 6, 30), data: Array.from({ length: 181 }, (_, i) => { const date = calendar.addWorkingDays(plainDate(2025, 12, 31), 1 + Math.floor(i * 0.7)); return { date, value: (i * 13) % 7 }; }), businessCalendar: calendar, colorScale: { color: 4, steps: 4 }, height: 200,});
for (const [name, chart] of [ ['candles', candles], ['network', network], ['calendar', absences],] as const) { sc.listen(chart.host, ['aui-series-toggle', 'aui-zoom', 'aui-point-click', 'aui-node-pin'], name);}
chartControls(sc, [candles, network, absences]);chartLook(sc, [candles, network, absences]);choice( sc, 'Candles', [ { value: 'candle', label: 'Candles' }, { value: 'ohlc', label: 'OHLC bars' }, ], 'candle', (type) => { candles.update({ type }); }, ['candlestick-chart'],);toggle(sc, 'Trading days only', true, (on) => { candles.update({ businessCalendar: on ? calendar : null, zoomRange: null });}, ['candlestick-chart']);action(sc, 'Re-run network layout', () => { network.relayout();}, ['network-graph']);Candles with volume and a moving average
Section titled “Candles with volume and a moving average”import { plainDate } from '@absoluteui/core';import { CandlestickChart } from '@absoluteui/components/candlestick-chart';
const host = document.createElement('div');document.body.append(host);CandlestickChart.create(host, { label: 'ACME share price', data: [ { date: plainDate(2026, 3, 2), open: 100, high: 104, low: 99, close: 103, volume: 12000 }, { date: plainDate(2026, 3, 3), open: 103, high: 105, low: 101, close: 102, volume: 9000 }, { date: plainDate(2026, 3, 4), open: 102, high: 103, low: 97, close: 98, volume: 15000 }, { date: plainDate(2026, 3, 5), open: 98, high: 101, low: 97, close: 100, volume: 11000 }, ], movingAverages: [{ period: 2 }], valueFormat: { style: 'currency', currency: 'USD' },});Trading days from a business calendar, zoom on
Section titled “Trading days from a business calendar, zoom on”import { plainDate } from '@absoluteui/core';import { createBusinessCalendar } from '@absoluteui/components/business-calendar';import { CandlestickChart } from '@absoluteui/components/candlestick-chart';
const calendar = createBusinessCalendar({ holidays: [{ date: plainDate(2026, 4, 3), name: 'Good Friday' }] });const host = document.querySelector<HTMLElement>('#equity');if (host) { const chart = CandlestickChart.create(host, { label: 'Equity', data: [ { date: plainDate(2026, 4, 2), open: 50, high: 52, low: 49, close: 51 }, { date: plainDate(2026, 4, 6), open: 51, high: 53, low: 50, close: 52.5 }, { date: plainDate(2026, 4, 7), open: 52.5, high: 53, low: 50.5, close: 51 }, ], businessCalendar: calendar, type: 'ohlc', zoom: true, }); chart.update({ zoomRange: { from: 0, to: 1 } });}Install and start
Section titled “Install and start”npm install @absoluteui/components @absoluteui/core @absoluteui/themeRegistry setup, the theme stylesheet, and the Content Security Policy are covered in Installation.
import { CandlestickChart } from '@absoluteui/components/candlestick-chart';import '@absoluteui/components/candlestick-chart/style.css';First use
Section titled “First use”import { plainDate } from '@absoluteui/core';import { CandlestickChart } from '@absoluteui/components/candlestick-chart';import '@absoluteui/components/candlestick-chart/style.css';
const host = document.querySelector<HTMLElement>('#price');if (host) { CandlestickChart.create(host, { label: 'Index', data: [ { date: plainDate(2026, 1, 5), open: 10, high: 11, low: 9.5, close: 10.8 }, { date: plainDate(2026, 1, 6), open: 10.8, high: 11.2, low: 10.1, close: 10.2 }, ], volume: false, });}More usage
Candles with volume and a moving average:
import { plainDate } from '@absoluteui/core';import { CandlestickChart } from '@absoluteui/components/candlestick-chart';
const host = document.createElement('div');document.body.append(host);CandlestickChart.create(host, { label: 'ACME share price', data: [ { date: plainDate(2026, 3, 2), open: 100, high: 104, low: 99, close: 103, volume: 12000 }, { date: plainDate(2026, 3, 3), open: 103, high: 105, low: 101, close: 102, volume: 9000 }, { date: plainDate(2026, 3, 4), open: 102, high: 103, low: 97, close: 98, volume: 15000 }, { date: plainDate(2026, 3, 5), open: 98, high: 101, low: 97, close: 100, volume: 11000 }, ], movingAverages: [{ period: 2 }], valueFormat: { style: 'currency', currency: 'USD' },});Trading days from a business calendar, zoom on:
import { plainDate } from '@absoluteui/core';import { createBusinessCalendar } from '@absoluteui/components/business-calendar';import { CandlestickChart } from '@absoluteui/components/candlestick-chart';
const calendar = createBusinessCalendar({ holidays: [{ date: plainDate(2026, 4, 3), name: 'Good Friday' }] });const host = document.querySelector<HTMLElement>('#equity');if (host) { const chart = CandlestickChart.create(host, { label: 'Equity', data: [ { date: plainDate(2026, 4, 2), open: 50, high: 52, low: 49, close: 51 }, { date: plainDate(2026, 4, 6), open: 51, high: 53, low: 50, close: 52.5 }, { date: plainDate(2026, 4, 7), open: 52.5, high: 53, low: 50.5, close: 51 }, ], businessCalendar: calendar, type: 'ohlc', zoom: true, }); chart.update({ zoomRange: { from: 0, to: 1 } });}Using Angular? See Candlestick Chart for Angular.
API reference
Section titled “API reference”Factory
Section titled “Factory”CandlestickChart.create(host: HTMLElement, options: CandlestickChartOptions): CandlestickChartGlobal configuration key: candlestickChart (see Configuration).
Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
label |
string |
Chart title: visible text and the accessible name of the plot (aria-labelledby); also the data table caption. Required. | |
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 (session count, date range, first and last close with the change, highest high and lowest low, sessions not plotted). | |
valueFormat |
Intl.NumberFormatOptions |
Number format for prices (tooltips, accessible names, table, summary, ticks). | |
formatValue |
(value: number) => string |
Custom value text; overrides valueFormat everywhere. | |
hiddenSeries |
readonly string[] |
Ids of hidden moving averages (legend toggles). | |
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?; axisColor?; lineWidth?; markerSize?; cornerRadius?; barRadius?; cellRadius?; sliceRadius?; boxRadius?; swatchRadius?; tooltipRadius?; controlRadius?; lineJoin?; areaOpacity?; gradient?; valueLabelColor?; tooltip?: { background?, color?, borderColor? }; legendPosition?: ‘top’ | ‘bottom’ | ‘start’ | ‘end’; animation?: boolean | { duration?: number } }. 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 |
(context: ChartTooltipContext) => Node | null |
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 and tooltip at the same column (session index) when one is hovered or focused. Use charts with the same sessions. | |
data |
readonly CandlestickPoint[] |
Sessions: { date: PlainDate (strictly increasing); open, high, low, close: finite numbers (high >= open, close, low; low <= open, close); volume?: number >= 0 }. At most 20,000. Required. | |
type |
'candle' | 'ohlc' |
"candle" |
Candles (hollow when rising, filled when falling) or OHLC bars (falling bars dashed). |
volume |
boolean |
true |
Volume pane below the prices when the data has volume. |
movingAverages |
readonly CandlestickMovingAverage[] |
Up to 4 simple moving averages of the close: { period: 2-250 sessions; id?: string (default “ma<period>”); label?: string; color?: 1-8; style?: ChartSeriesStyle }. | |
businessCalendar |
BusinessCalendarEngine | null |
Business calendar (createBusinessCalendar from @absoluteui/components/business-calendar): the axis counts trading days only, so weekends and holidays take no space; sessions on non-working days are not plotted and are listed in the summary. Without it the axis is a calendar-day axis with gaps. | |
priceAxis |
Omit<ValueAxisInput, 'includeZero'> |
Price axis: { label?, min?, max?, tickCount? (2-20) }. | |
volumeFormat |
Intl.NumberFormatOptions |
Volume format (tooltips, table, pane label). Default compact notation. | |
zoom |
boolean |
false |
Zoom and pan over time: toolbar buttons, + / - / 0 keys, Ctrl/Cmd + wheel, drag to pan, Shift + drag to select. |
zoomRange |
ChartZoomRange | null |
Visible axis range { from, to } in axis positions (trading-day or day index from the first session); null shows everything. | |
legend |
'auto' | 'show' | 'hide' |
"auto" |
Legend of the moving averages (toggle buttons): auto shows it when there is at least one average, show always, hide never. Globally configurable. |
dataTable |
'toggle' | 'visible' | 'hidden' | 'none' |
"toggle" |
Data table fallback (date, open, high, low, close, volume, and every moving average): behind a Show data table button (built on first open), always visible, visually hidden (screen readers only), or none. Globally configurable. |
tooltip |
boolean |
true |
Tooltip on pointer hover and keyboard focus. Globally configurable. |
patterns |
boolean |
false |
Dash patterns on the moving averages (WCAG 1.4.1). Candles are always hollow (rising) or filled (falling). Forced-colors mode always shows them. Globally configurable. |
height |
number |
300 |
Plot height in CSS px (integer 120-2000); the width follows the container. Globally configurable. |
crosshair |
boolean |
true |
Crosshair lines (time and price) on the hovered or focused session. Globally configurable. |
locale |
string |
"en-US" |
Number, date, and message locale. Globally configurable. Inherited from common configuration. |
direction |
'ltr' | 'rtl' |
"ltr" |
rtl mirrors the time axis and swaps ArrowLeft/ArrowRight. Globally configurable. Inherited from common configuration. |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
host |
HTMLElement |
The host element. |
element |
SVGSVGElement |
The plot (svg role=“group”), named by the title and described by the summary. |
summary |
string |
The generated (or custom) accessible summary. |
hiddenSeries |
string[] |
Ids of hidden items (legend toggles). |
zoomRange |
ChartZoomRange | null |
Visible axis range, or null. |
Methods
Section titled “Methods”| Method | Description |
|---|---|
update(options: Partial<CandlestickChartOptions>): void |
Merge, validate, and re-render. Invalid options throw and keep the previous state. Keyboard focus stays on the same mark. |
setSeriesVisible(id: string, visible: boolean): void |
Show or hide an item programmatically (no event). |
destroy(): void |
Remove rendering, host classes, listeners, the resize observer, timers, and the configuration subscription. |
Events
Section titled “Events”| Event | Detail | Bubbles | Cancelable | Description |
|---|---|---|---|---|
aui-point-click |
CandlestickChartPointClickDetail = ChartPointClickDetail: { seriesId: string | null; column: number; row: number; label: string; series: string; value: string; source: 'pointer' | 'keyboard' } |
Yes | No | A candle was activated: pointer click or tap, or Enter / Space on the focused candle. label is the date, column the session index, value the formatted close. |
aui-series-toggle |
CandlestickChartSeriesToggleDetail: { id: string; visible: boolean; hidden: string[] } |
Yes | No | A moving average was shown or hidden from the legend. |
aui-zoom |
CandlestickChartZoomDetail: { x: ChartZoomRange | null; y: null; reason: 'button' | 'keyboard' | 'wheel' | 'pan' | 'select' | 'reset' } |
Yes | No | The visible range changed (also announced politely). |
CSS classes
Section titled “CSS classes”All rules live in the aui.components cascade layer, so application styles override them without specificity battles.
| Class | Purpose |
|---|---|
aui-chart |
Host (shared chart chrome). |
aui-candlestick-chart |
Host modifier for this chart type. |
aui-chart__header / __title / __title--hidden / __description / __toolbar |
Title, description, and the toolbar (zoom buttons). |
aui-chart__legend / __legend-entry / __legend-item / __legend-label / __swatch |
Legend and its aria-hidden keys. |
aui-chart__body / __svg / __layer |
Plot container (height from –aui-chart-height), SVG, and drawing layer. |
aui-chart__series--c1 ... --c8 |
Palette slot classes; set –aui-chart-color from –aui-chart-<n>. |
aui-chart__mark / __mark--active / __mark--hover |
Focusable marks and their states. |
aui-chart__tooltip / __tooltip--custom / __tooltip-title / __tooltip-row |
Tooltip (aria-hidden; the focused mark carries the same text). |
aui-chart__empty / __summary |
Empty state text and the hidden summary referenced by aria-describedby. |
aui-chart__data / __data--hidden / __table-toggle / __table-scroll / __table |
Data table fallback. |
aui-chart--legend-bottom / --legend-start / --legend-end / --animate / --entering |
theme.legendPosition and theme.animation. |
aui-candlestick-chart__candles / __candle / __candle--up / __candle--down |
Candles (focusable marks): hollow rising, filled falling. |
aui-candlestick-chart__bar / __bar--up / __bar--down |
OHLC bars (type ohlc); falling bars dashed. |
aui-candlestick-chart__volume / __volume-bar--up / --down |
aria-hidden volume pane. |
aui-candlestick-chart__averages / aui-chart__line |
aria-hidden moving-average lines. |
aui-chart__crosshair / __crosshair-line |
Crosshair (aria-hidden). |
aui-chart--zoomable / --zoomed / aui-chart__zoom / __tool / __brush |
Zoom toolbar and selection brush. |
Design tokens
Section titled “Design tokens”Tokens this stylesheet reads (verified in CI). Override them in a theme or with the Theme Designer.
--aui-border-width | --aui-color-border | --aui-color-border-strong | --aui-color-chart-1 | --aui-color-chart-2 | --aui-color-chart-3 | --aui-color-chart-4 | --aui-color-chart-5 | --aui-color-chart-6 | --aui-color-chart-7 | --aui-color-chart-8 | --aui-color-chart-axis | --aui-color-chart-grid | --aui-color-error-fg | --aui-color-focus-ring | --aui-color-hover | --aui-color-info-fg | --aui-color-link | --aui-color-success-fg | --aui-color-surface | --aui-color-surface-sunken | --aui-color-text | --aui-color-text-muted | --aui-color-warning-fg | --aui-duration-fast | --aui-easing-standard | --aui-focus-ring-offset | --aui-focus-ring-width | --aui-font-family-sans | --aui-font-size-md | --aui-font-size-sm | --aui-font-size-xs | --aui-font-weight-medium | --aui-font-weight-regular | --aui-font-weight-semibold | --aui-line-height-normal | --aui-line-height-tight | --aui-radius-md | --aui-radius-sm | --aui-shadow-md | --aui-space-1 | --aui-space-2 | --aui-space-3 | --aui-tooltip-max-width | --aui-touch-target-min
TypeScript definitions
type CandlestickChartType = 'candle' | 'ohlc';interface CandlestickChartConfig extends ChartBaseConfig { crosshair: boolean }interface CandlestickPoint { date: PlainDate; open: number; high: number; low: number; close: number; volume?: number }interface CandlestickMovingAverage { period: number; id?: string; label?: string; color?: ChartColor; style?: ChartSeriesStyle }interface CandlestickChartOptions extends ChartCommonOptions, Partial<CandlestickChartConfig> { data: readonly CandlestickPoint[]; type?: CandlestickChartType; volume?: boolean; movingAverages?: readonly CandlestickMovingAverage[]; businessCalendar?: BusinessCalendarEngine | null; priceAxis?: Omit<ValueAxisInput, 'includeZero'>; volumeFormat?: Intl.NumberFormatOptions; zoom?: boolean; zoomRange?: ChartZoomRange | null;}Accessibility and performance
Section titled “Accessibility and performance”Accessibility
Section titled “Accessibility”Pattern: SVG time-series chart as a named, described group (role=“group” with aria-roledescription “candlestick chart”) of role=“img” candles with roving focus along the sessions; a legend of toggle buttons for moving averages; zoom toolbar; data table fallback.
Checked on every docs build: the showcase passes axe (WCAG 2.2 A and AA rules) in the default, dark, and high-contrast themes and right to left; the playground loads without errors and passes axe before and after every on/off option is switched, with no Content Security Policy violations.
Keyboard
Section titled “Keyboard”| Key | Context | Action |
|---|---|---|
| ArrowLeft / ArrowRight (also ArrowUp / ArrowDown) | Candle focused | Previous / next session (swapped in RTL); past the window edge a zoomed chart pans. |
| Home / End | Candle focused | First / last visible session. |
| PageUp / PageDown | Candle focused | Ten sessions back / forward (clamped to the visible window). |
| + / = and - / _ | Mark focused, zoom on | Zoom in / out around the focused mark (announced politely, aui-zoom). |
| 0 | Mark focused, zoom on | Reset the zoom. |
| Enter / Space | Mark focused | Fires aui-point-click with source “keyboard”. |
| Escape | Tooltip visible | Hides the tooltip without moving focus (WCAG 1.4.13); it returns on the next move. |
| Tab / Shift+Tab | Any | One tab stop for the plot (the active mark), the zoom buttons, the legend buttons, then the Show data table button and the table region. |
| Element | Role |
|---|---|
| svg.aui-chart__svg | group with aria-roledescription “candlestick chart” (localized), named by the title |
| candles (path.aui-candlestick-chart__candle) | img with an aria-label: date, open, high, low, close, change |
| legend | list of toggle buttons (aria-pressed) for moving averages |
| zoom toolbar | group “Zoom” of buttons (aria-disabled when unavailable) |
| data table | table (native) with caption, column headers, and row headers |
| axes, volume pane, averages, crosshair, tooltip | aria-hidden (decorative duplicates of the accessible data) |
ARIA attributes
Section titled “ARIA attributes”| Attribute | Element | Value |
|---|---|---|
aria-labelledby |
svg | id of the visible (or visually hidden) title |
aria-describedby |
svg | description id (when provided) and the generated summary id |
aria-roledescription |
svg | Localized “candlestick chart” |
tabindex |
active mark | 0 on exactly one mark (roving); other marks have none |
aria-expanded / aria-controls |
Show data table button | Table open state and the table region id |
aria-label |
each mark | Localized: date, open, high, low, close, change |
Roving focus: one candle is in the tab sequence and keeps the last visited session across re-renders, zoom, and pan.
WCAG 2.2 success criteria addressed
Section titled “WCAG 2.2 success criteria addressed”Automated test results: Accessibility and compliance.
Notes and known caveats
Section titled “Notes and known caveats”- Direction is shown by shape (hollow rising, filled falling candles; dashed falling OHLC bars) and named in each accessible name (“up 1.2 %”), never by color alone.
- Zoom and pan have keyboard and button equivalents for every pointer gesture (WCAG 2.5.7).
- The generated summary names the range, the change from first to last close, the extremes, and any sessions not plotted on non-trading days.
- Manual screen-reader verification (NVDA, JAWS, VoiceOver, TalkBack) is pending.
- aria-roledescription support varies; screen readers without it announce “group”.
Performance
Section titled “Performance”| Import cost | Minified | gzip | brotli | CSS brotli |
|---|---|---|---|---|
@absoluteui/components/candlestick-chart |
90.3 kB | 31.4 kB | 27.6 kB | 2.5 kB |
Measured at build time, including every AbsoluteUI module the component pulls in. No third-party runtime dependencies.
| Budget (enforced in CI) | Limit |
|---|---|
| CandlestickChart.create with 1,000 sessions, volume, and two moving averages, including the first render | < 120 ms in headless Chromium |
Tested scale: Designed for up to about 5,000 sessions (about 20 years of trading days) with zoom; at most 20,000 are accepted. Every visible candle is a focusable SVG path.
Budget: CandlestickChart.create with 1,000 sessions, volume, and two moving averages, including the first render < 120 ms in headless Chromium. One number formatter per render; the data table is built lazily.
Measured run times: Performance.
Details
Section titled “Details”States
default (candles); OHLC bars; with volume pane; with moving averages; zoomed (pan by drag or arrow keys); empty (no sessions: No data); session focused (crosshair, tooltip); table open.
State transitions
| From | Trigger | To |
|---|---|---|
| plot not focused | Tab | active candle focused, crosshair and tooltip shown |
| candle focused | arrow keys, Home, End, PageUp, PageDown | another candle focused (zoomed charts pan past the edge) |
| not zoomed | + / toolbar / Ctrl+wheel / Shift+drag | zoomed (aui-zoom) |
| zoomed | 0 / Reset zoom | full range (aui-zoom) |
| any | legend button | moving average hidden or shown (aui-series-toggle) |
| any | update() / configuration change |
re-rendered; focus kept on the same session |
Accessibility notes
- Direction is shown by shape (hollow rising, filled falling candles; dashed falling OHLC bars) and named in each accessible name (“up 1.2 %”), never by color alone.
- Zoom and pan have keyboard and button equivalents for every pointer gesture (WCAG 2.5.7).
- The generated summary names the range, the change from first to last close, the extremes, and any sessions not plotted on non-trading days.
- Manual screen-reader verification (NVDA, JAWS, VoiceOver, TalkBack) is pending.
- aria-roledescription support varies; screen readers without it announce “group”.
Responsive behavior
The width follows the container (ResizeObserver); candles share the plot width (body width capped at 24px) and date labels are thinned to fit. The price axis rescales to the visible sessions when zoomed. Wide data tables scroll in a focusable region.
Right-to-left
direction rtl mirrors the time axis (earliest session on the right), moves the price axis to the right, and swaps ArrowLeft/ArrowRight.
Theming
Rising candles: color-surface body outlined with –aui-candlestick-chart-up-color (color-success-fg); falling candles: filled with –aui-candlestick-chart-down-color (color-error-fg); falling OHLC bars are dashed. Moving averages use palette slots. Forced colors: hollow and filled CanvasText candles, Highlight on focus.
Global configuration
configureAbsoluteUI({ components: { candlestickChart: { crosshair: true, dataTable: 'visible' } } });Changes apply to existing instances immediately.
Component configuration
Instance options override global and theme defaults. All options are dynamic.
Timezones
Dates are PlainDate values (calendar days without a time zone); nothing is converted. Business-calendar awareness comes from businessCalendar.
Icons
The zoom toolbar uses the built-in plus, minus, and refresh icons (register replacements through the icon registry).
Security
All text uses textContent; SVG uses createElementNS; colors are classes or CSSOM custom properties. No innerHTML or style attributes.
Data handling
No persistence, network access, or telemetry.
Supported data scale
Designed for up to about 5,000 sessions (about 20 years of trading days) with zoom; at most 20,000 are accepted. Every visible candle is a focusable SVG path.
Edge cases
- Sessions on non-working days of the business calendar are not plotted and are listed in the summary.
- A doji (open equals close) is drawn with a 1px body and reads “unchanged”.
- The first session has no previous close: its change is measured from its open.
- Moving averages start once their period is filled.
Errors
Invalid options throw a configuration error (code CANDLESTICK_CHART_OPTIONS) naming the option and the expected value, before anything renders; update() with invalid options throws and keeps the previous state. Errors never include option values.
Known limitations
- Daily sessions only (PlainDate); no intraday or weekly aggregation.
- Simple moving averages of the close only (up to four).
- Manual screen-reader verification is pending.
Unsupported scenarios
- Logarithmic price axes.
- Drawing tools (trend lines, annotations by pointer).
- Live streaming updates beyond update().
(c) 2026 Kasadara Technology Solutions Pvt Ltd. AbsoluteUI is free to use under the AbsoluteUI Free Use License; it is not open source.