Skip to content
EspañolEnglish
All components (283)

Candlestick chart

Data · CandlestickChart

What it is and when to use it

Open, high, low and close candles, for prices. A rising candle is hollow and a falling one is filled: colour is not the only thing telling them apart.

When to use it

  • Prices per period: a quote, a commodity.
  • data are the candles, in order: { label, open, high, low, close }.

When not to

  • A price without its range for the period: LineChart.

Keyboard: Tab takes you to the drawing and the arrows move from candle to candle; Home and End go to the first and last. A spoken notice says the four values.

Accessibility: it is an image (role="img") with a written summary, and underneath goes a real table with the four values of each candle.

Fine-tuning: the --amset-series-* CSS variables of the other charts: -axis, -bar, -cap, -footer, -height, -label.

What it looks like

Use the arrow keys to move through the values, Home and End to jump to the first and last, and Escape to leave.
Silver, euros per ounce
PeriodOpenHighLowClose
Mon24282227
Tue27292526
Wed26312630
Thu30332829
Fri29302425
Mon25272325
Tue25322531
Wed31353034

<CandlestickChart label="Silver, euros per ounce" data={velas} />

Props

Import it with import { CandlestickChart } from '@amset/ui'. Required props are marked.

PropTypeWhat it does
datarequiredreadonly CandlePoint[]The candles, in order: `{ label, open, high, low, close }`.
labelrequiredstringWhat is being measured. Required: a chart without a title does not inform.
classNamestringMerged with the library classes; it does not replace them.
errorReactNodeThe data has not arrived: it says so in the place of the drawing, with what is passed here.
format(value: number) => string—
heightnumberHeight of the drawing in pixels. By default, that of the size.
loadingbooleanThe data is on its way.
size"sm" | "md" | "lg"—
tableVisiblebooleanAlso shows the table. For the screen reader it is always there.

It also accepts the attributes of the element it renders: className, style, data-*, aria-* and its events.

In the test bench

Every state and variant, to try one at a time, on its page at storybook.amsetui.com: