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?
optionallayer?: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()?
optionalattached(host):void
Defined in: packages/core/src/numeric/types.ts:62
Parameters
host
Returns
void
detached()?
optionaldetached():void
Defined in: packages/core/src/numeric/types.ts:63
Returns
void
drawPlot()?
optionaldrawPlot(ctx,env):void
Defined in: packages/core/src/numeric/types.ts:65
Draw in the plot area, clipped to it.
Parameters
ctx
CanvasRenderingContext2D
env
Returns
void
priceAxisLabels()?
optionalpriceAxisLabels(env):PriceAxisLabel[]
Defined in: packages/core/src/numeric/types.ts:67
Labels on the price axis, drawn like price line labels.
Parameters
env
Returns
priceRange()?
optionalpriceRange(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