Charts
CandlestickChart
Financial OHLC candlestick chart with keyboard period exploration and an accessible data table.
import '@reactloom/charts/styles.css';
import { CandlestickChart } from '@reactloom/charts';Examples
OHLC price series
import { CandlestickChart } from '@reactloom/charts';
const data = [
{ date: 'Mon', open: 102, high: 112, low: 98, close: 109 },
{ date: 'Tue', open: 109, high: 116, low: 104, close: 106 },
{ date: 'Wed', open: 106, high: 118, low: 105, close: 115 },
{ date: 'Thu', open: 115, high: 121, low: 110, close: 119 },
];
export default function Example() {
return <CandlestickChart title="Weekly share price" data={data} x="date" open="open" high="high" low="low" close="close" />;
}API reference
| Prop | Type | Default |
|---|---|---|
datarequiredOHLC records. | readonly Row[] | — |
xrequiredPeriod or date accessor. | Accessor<Row, XValue> | — |
open · high · low · closerequiredAccessors for the four OHLC values. | Accessor<Row, number> | — |
Keyboard interaction
| Key | Action |
|---|---|
| ArrowLeft / ArrowRight | Inspect each period and announce open, high, low, and close |
Usage guidelines
Do
- Keep the data table toggle enabled so screen-reader users can inspect exact OHLC values.
Don’t
- Avoid plotting hundreds of candles without aggregating into weekly or monthly intervals.