Skip to content
Calm motion: animations on this site only fade, with no movement

Candlestick ​

The open, high, low, and close of each period

Shows how a price or a range moves each day. Each period is a candle. The thin line goes from the low to the high, and the box goes from the open to the close. For one value each day, use the line chart.

Basic
Share price, 3 to 14 November
PeriodOpenHighLowClose
3 Nov$120$126$118$124
4 Nov$124$128$121$122
5 Nov$122$123$115$116
6 Nov$116$120$113$119
7 Nov$119$125$118$125
10 Nov$125$131$124$130
11 Nov$130$132$126$127
12 Nov$127$129$122$123
13 Nov$123$128$121$127
14 Nov$127$134$126$133
  • data is a list of periods. Each period has a label and the numbers open, high, low, and close.
  • A period that closes at or above its open is hollow, in the up color (default success). A period that closes below its open is filled, in the down color (default danger). The shape tells the two apart, so the color is not the only sign.
  • The axis starts and ends at round numbers around the lowest low and the highest high. If the chart is narrow, the labels under the candles skip some periods.
  • format sets the text of a value, and height sets the height in pixels (default 260).
  • For screen readers, the chart is a table with a row for each period. label names the table. Change the column names with labels or a label pack: period, open, high, low, and close.

Usage ​

ts
import { BlessCandlestick } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
data*BlessCandle[]—
heightnumber260
upstring"success"the color of a period that closes at or above its open; drawn hollow
downstring"danger"the color of a period that closes below its open; drawn filled
format((v: number) => string)—text for one value, for example `(v) => "$" + v`
labelstring"Chart"names the chart and its table for screen readers
labelsPartial<{ period: string; open: string; high: string; low: string; close: string; }>—

Released under the MIT License. Character names and artwork belong to their owners.