Skip to content

Documentation / @finchart/core / index / CandleSeries

Class: CandleSeries ​

Defined in: packages/core/src/series/candle-series.ts:54

A data representation that can be swapped out on the same stage (Plot).

The grid, axes, pan/zoom, and layers belong to Plot, so they stay put even when the series changes. A series answers five things — how much of the y axis it occupies, how it draws, and (optionally) how its points are thinned, how their coordinates are read, and what a tooltip says about one of them (describe, the series' alone — no registration overrides it). The two policies are resolved registration first, then the series, then the fallback: a registration's coordinates wins over the series', and plain x/y reads when neither says; a registration's decimation fields win over the series' field by field, and the wiring's policy fills what neither sets.

Implements ​

Constructors ​

Constructor ​

new CandleSeries(overrides?, draws?): CandleSeries

Defined in: packages/core/src/series/candle-series.ts:79

Parameters ​

overrides? ​

CandleSeriesStyleOverrides = {}

draws? ​

CandleDrawOptions = {}

Returns ​

CandleSeries

Properties ​

barBody ​

readonly barBody: true = true

Defined in: packages/core/src/series/candle-series.ts:62

Whether each point is drawn as a body one bar slot wide — a candle, a bar, a histogram column. A fit pads the chart by half a bar at each end when any series says so, so the end bodies are drawn whole; a chart of lines alone fits edge to edge.

Implementation of ​

Series.barBody


coordinates ​

readonly coordinates: CoordinateAccessor<OHLC> = OHLC_COORDINATES

Defined in: packages/core/src/series/candle-series.ts:65

A candle's value is close. OHLC has no y, so the default accessor can't read it.

Implementation of ​

Series.coordinates


decimation ​

readonly decimation: Readonly<{ pointsPerPixel: 1; strategy: Readonly<OhlcAggregation>; }> = OHLC_DECIMATION

Defined in: packages/core/src/series/candle-series.ts:61

A candle is aggregated, not thinned. One per pixel is the ceiling — thinning would lose that interval's high and low, and drawing two candles into one pixel just means the later one covers the earlier one.

Implementation of ​

Series.decimation

Methods ​

describe() ​

describe(point): readonly SeriesRow[]

Defined in: packages/core/src/series/candle-series.ts:68

O/H/L/C, and V when the bar carries a volume — a gap (null or absent) is left out, not shown as a dash.

Parameters ​

point ​

OHLC

Returns ​

readonly SeriesRow[]

Implementation of ​

Series.describe


draw() ​

draw(target, context): void

Defined in: packages/core/src/series/candle-series.ts:102

Parameters ​

target ​

DrawTarget

context ​

SeriesContext<OHLC>

Returns ​

void

Implementation of ​

Series.draw


valueExtent() ​

valueExtent(data): Range | null

Defined in: packages/core/src/series/candle-series.ts:88

A candle occupies the low-to-high span. Looking only at close would let the wick stick out past the plot.

Parameters ​

data ​

DataView<OHLC>

Returns ​

Range | null

Implementation of ​

Series.valueExtent