DocumentationNuxt Charts v3

Candlestick Chart

Learn how to implement and customize Candlestick Charts in your Nuxt application.

The CandlestickChart component renders OHLC (open, high, low, close) price action with an optional volume histogram — the standard view for stocks, crypto and other financial time series. New in v3.

Basic Usage

Props

PropTypeDefaultDescription
dataT[]RequiredArray of rows. Each row is one candle.
heightnumberRequiredHeight of the chart in pixels.
xAccessorkeyof T'label'Row field used for the x (category) axis label.
openAccessorkeyof T'open'Row field for the open price.
highAccessorkeyof T'high'Row field for the high price.
lowAccessorkeyof T'low'Row field for the low price.
closeAccessorkeyof T'close'Row field for the close price.
volumeAccessorkeyof T'volume'Optional row field for the traded volume.
upColorstring'#10b981'Colour for rising candles (close ≥ open).
downColorstring'#ef4444'Colour for falling candles (close < open).
candleWidthnumber18Max candle body width in pixels.
wickWidthnumber1.5Wick (high-low line) width in pixels.
showVolumebooleanfalseDraw a volume histogram beneath the candles.
yFormatter(value: number) => stringundefinedFormats y-axis ticks and tooltip prices.
xFormatter(index: number) => stringundefinedFormats x-axis (category) ticks. Receives the row index.
yNumTicksnumberundefinedDesired number of y-axis ticks.
yDomain[number | undefined, number | undefined]data rangeFixed y-axis domain as [min, max].
xGridLinebooleanfalseShow vertical grid lines.
yGridLinebooleantrueShow horizontal grid lines.
hideXAxisbooleanfalseIf true, hides the x-axis.
hideYAxisbooleanfalseIf true, hides the y-axis.
hideTooltipbooleanfalseIf true, hides the tooltip.
tooltipTooltipConfigundefinedTooltip configuration.

Data Format

Each object is one candle. With the default accessors, a row shaped like the following works with no extra configuration.

types.ts
interface CandlestickData {
  label: string;
  open: number;
  high: number;
  low: number;
  close: number;
  volume?: number;
}