Skip to content

CandlestickChart

Stable

Price candles for open, high, low and close. Up and down are told apart by shape and by words, not by colour alone.

Also known as ohlc chart, stock chart

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Forty days with volume and a table

Acme price, 40 days

Price in dollars, one candle per day

The price drifted within a narrow range. Hollow candles closed up, filled candles closed down.

Source: demo data

The usual setup. The frame adds a title, a summary and a View as table button.

When to use it

Shows how a price moved inside each period, so people can see the range and the direction at once.

Made of: Side scale with 4 to 6 marks · Thin grid lines · Candles: thin line and box · Volume strip (optional) · Bottom labels · Guide line and pop-up

Use it for

  • A share, coin or any price with open, high, low and close for each day or minute.
  • A live price where the last candle keeps changing: turn on streaming.
  • Showing how much was traded under each candle: turn on volume.

Not for

  • A single trend line with one value per day: use LineChart.
  • A trend in a very small space: use Sparkline.
  • Comparing amounts between groups: use BarChart.

Do and avoid

Acme share price

Price in dollars, last 10 days

Do. Ten candles have room to show each day's range and direction.

Acme share price

Price in dollars, last 200 days

Avoid. Hundreds of candles in a small box blur into noise.

Do

  • Put it in a ChartFrame with a summary and the table from candlestickTable.
  • Keep up as hollow and down as filled, so direction never depends on colour alone.
  • Turn on streaming when the last candle can still change.
  • Say the currency or unit in the ChartFrame subtitle.

Avoid

  • Don't use it for one value per day. Use a line chart.
  • Don't squeeze hundreds of candles into a narrow space. Pass fewer candles or a longer period.
  • Don't reverse the meaning of hollow and filled in one product.

On a phone

  • The chart measures its container and redraws at that width.
  • Touch or drag across the chart to read a candle. Vertical swipes still scroll the page, and the tooltip stays until you tap elsewhere.
  • The tooltip flips to the left of your finger past the middle of the chart.
  • Give the chart a short date range on a phone, because every candle needs room to be seen.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started