Skip to content

Class: CandlestickLayer

Defined in: layers/candlestick.ts:114

A drawable data series backed by GPU buffers.

Implements

Constructors

Constructor

ts
new CandlestickLayer(gl, opts): CandlestickLayer;

Defined in: layers/candlestick.ts:148

Parameters

ParameterType
glWebGL2RenderingContext
optsCandlestickOptions

Returns

CandlestickLayer

Properties

colorCss

ts
readonly colorCss: string;

Defined in: layers/candlestick.ts:117


id

ts
readonly id: string;

Defined in: layers/candlestick.ts:115

Implementation of

Layer.id


name

ts
readonly name: string;

Defined in: layers/candlestick.ts:116


yAxis

ts
readonly yAxis: string;

Defined in: layers/candlestick.ts:118

The y axis this layer is bound to.

Implementation of

Layer.yAxis

Methods

appendCandle()

ts
appendCandle(c): void;

Defined in: layers/candlestick.ts:283

Append one new candle (grows the series). Prefer updateLast for the in-progress candle and appendCandle only when a bar closes and a new one opens.

Parameters

ParameterType
cCandle

Returns

void


bounds()

ts
bounds(): 
  | {
  x: Range;
  y: Range;
}
  | null;

Defined in: layers/candlestick.ts:315

Data-space bounds of this layer, for autoscaling. null if empty.

Returns

| { x: Range; y: Range; } | null

Implementation of

Layer.bounds


dispose()

ts
dispose(): void;

Defined in: layers/candlestick.ts:339

Returns

void

Implementation of

Layer.dispose


draw()

ts
draw(state): void;

Defined in: layers/candlestick.ts:320

Parameters

ParameterType
stateDrawState

Returns

void

Implementation of

Layer.draw


setData()

ts
setData(data): void;

Defined in: layers/candlestick.ts:273

Replace every candle and re-upload (for streaming a whole new window).

Parameters

ParameterType
dataCandlestickData

Returns

void


updateLast()

ts
updateLast(c): void;

Defined in: layers/candlestick.ts:295

Update the most recent candle in place — the cheap hot path for a live (forming) bar. Only that candle's 12 floats are re-uploaded; bounds are extended (never shrunk) to include it. No-op when the series is empty.

Parameters

ParameterType
cCandle

Returns

void

MIT licensed. WebGL2 required.