Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Candlestick Chart

Preview

ETH / USD · 5m Simulated
Candle
15:55
O
2,360.34
H
2,369.93
L
2,351.12
C
2,368.44
Vol
151.2
+0.34%

Install

Add it with your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/candlestick-chart

Import the shared styles once in your application.

TSUsage
import CandlestickChart from '@/components/beui/charts/CandlestickChart.vue'
import '@/components/beui/styles.css'

API Reference

CandlestickChart

candles
readonly Candle[]
Default—
lastPrice?
number

Draws a dashed line and tag at this price, usually the last trade.

Default—
v-model:activeId?
string | null

Controlled crosshair candle, by `id`, so it stays on the same candle as new ones arrive.

Default—
defaultActiveId?
string | null
Default—
formatPrice?
(value: number) => string
Default—
formatVolume?
(value: number) => string
Default—
label?
string

Accessible name for the chart.

Default—
labels?
Partial<CandlestickChartMessages>

Override any built-in string.

Default—
class?
string
Default—
@active-id-change?
(id: string | null) => void
Default—
#default?
slot

Compose `CandlestickChartLegend` and `CandlestickChartPlot`; omit it for the complete chart. ```vue <CandlestickChart :candles="candles" :last-price="last" :format-price="usd"> <CandlestickChartLegend /> <CandlestickChartPlot :height="360" /> </CandlestickChart> ```

Default—

CandlestickChartLegend

#default?
{ candle: Candle; change: number }

Custom readout. Receives the crosshair candle, or the latest one, and its percent change.

Default—
class?
string
Default—

CandlestickChartPlot

height?
number

Plot height in px.

Default320
class?
string
Default—

Updated