Skip to content

charton API


charton API / @chart-on/core / index / NumericPrimitive

Interface: NumericPrimitive ​

Defined in: packages/core/src/numeric/types.ts:59

Plugin that draws on a NumericChart, such as a marker, a band or an alert line. Every member is optional. Attach with chart.attachPrimitive.

Properties ​

layer? ​

optional layer?: PrimitiveLayer

Defined in: packages/core/src/numeric/types.ts:61

'below' the series, 'normal' (default) over them, or 'top' over price lines and the crosshair.

Methods ​

attached()? ​

optional attached(host): void

Defined in: packages/core/src/numeric/types.ts:62

Parameters ​

host ​

NumericPrimitiveHost

Returns ​

void


detached()? ​

optional detached(): void

Defined in: packages/core/src/numeric/types.ts:63

Returns ​

void


drawPlot()? ​

optional drawPlot(ctx, env): void

Defined in: packages/core/src/numeric/types.ts:65

Draw in the plot area, clipped to it.

Parameters ​

ctx ​

CanvasRenderingContext2D

env ​

NumericPrimitiveEnv

Returns ​

void


priceAxisLabels()? ​

optional priceAxisLabels(env): PriceAxisLabel[]

Defined in: packages/core/src/numeric/types.ts:67

Labels on the price axis, drawn like price line labels.

Parameters ​

env ​

NumericPrimitiveEnv

Returns ​

PriceAxisLabel[]


priceRange()? ​

optional priceRange(from, to): [number, number] | null

Defined in: packages/core/src/numeric/types.ts:69

Price span to keep in view while x from from to to is visible.

Parameters ​

from ​

number

to ​

number

Returns ​

[number, number] | null