Skip to content

Class: OhlcLayer

Defined in: layers/ohlc.ts:86

A drawable data series backed by GPU buffers.

Implements

Constructors

Constructor

ts
new OhlcLayer(gl, opts): OhlcLayer;

Defined in: layers/ohlc.ts:115

Parameters

ParameterType
glWebGL2RenderingContext
optsOhlcOptions

Returns

OhlcLayer

Properties

colorCss

ts
readonly colorCss: string;

Defined in: layers/ohlc.ts:89


id

ts
readonly id: string;

Defined in: layers/ohlc.ts:87

Implementation of

Layer.id


name

ts
readonly name: string;

Defined in: layers/ohlc.ts:88


yAxis

ts
readonly yAxis: string;

Defined in: layers/ohlc.ts:90

The y axis this layer is bound to.

Implementation of

Layer.yAxis

Methods

appendCandle()

ts
appendCandle(c): void;

Defined in: layers/ohlc.ts:221

Append one new bar (grows the series).

Parameters

ParameterType
cCandle

Returns

void


bounds()

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

Defined in: layers/ohlc.ts:248

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/ohlc.ts:265

Returns

void

Implementation of

Layer.dispose


draw()

ts
draw(state): void;

Defined in: layers/ohlc.ts:253

Parameters

ParameterType
stateDrawState

Returns

void

Implementation of

Layer.draw


setData()

ts
setData(data): void;

Defined in: layers/ohlc.ts:214

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

Parameters

ParameterType
dataCandlestickData

Returns

void


updateLast()

ts
updateLast(c): void;

Defined in: layers/ohlc.ts:229

Update the most recent bar in place — the cheap hot path for a live bar.

Parameters

ParameterType
cCandle

Returns

void

MIT licensed. WebGL2 required.