Skip to content

charton API


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

Interface: AlertLineOptions ​

Defined in: packages/core/src/annotations/types.ts:367

Options of an alert line. The chart only shows and edits alerts; checking them against live prices is the application's job (see alertsCrossed). A line can be dragged only with onDrag or onChange, and has a remove button only with onRemove.

Extends ​

Properties ​

color? ​

optional color?: string

Defined in: packages/core/src/annotations/types.ts:374

Default: the theme's alert colour.


label ​

label: string

Defined in: packages/core/src/annotations/types.ts:370

First segment of the label block. Default: Alert.


labelAnchor? ​

optional labelAnchor?: LabelAnchor

Defined in: packages/core/src/annotations/types.ts:160

Where the label block sits: right (default, next to the price axis), center or left. Brackets follow their order.

Inherited from ​

LineLabelOptions.labelAnchor


lineOnly? ​

optional lineOnly?: boolean

Defined in: packages/core/src/annotations/types.ts:164

Only the line: no label block, no hit testing. For dense ladders of many orders.

Inherited from ​

LineLabelOptions.lineOnly


lineStyle ​

lineStyle: LineStyle

Defined in: packages/core/src/annotations/types.ts:377

Default: dotted, so alerts read differently from order and position lines.


lineWidth ​

lineWidth: number

Defined in: packages/core/src/annotations/types.ts:375


onChange? ​

optional onChange?: (e) => void

Defined in: packages/core/src/annotations/types.ts:385

Drag released at a new price. The line keeps the new price.

Parameters ​

e ​

AlertLineChangeEvent

Returns ​

void


onClick? ​

optional onClick?: (e) => void

Defined in: packages/core/src/annotations/types.ts:152

Pressed and released on the line or its block without dragging it. Never after a drag.

Parameters ​

e ​

LinePointerEvent<AlertLine>

Returns ​

void

Inherited from ​

LineInteractionOptions.onClick


onDrag? ​

optional onDrag?: (e) => void

Defined in: packages/core/src/annotations/types.ts:383

While dragging, whenever the snapped price changes (and once more after Escape).

Parameters ​

e ​

AlertLineDragEvent

Returns ​

void


onHover? ​

optional onHover?: (e) => void

Defined in: packages/core/src/annotations/types.ts:148

The pointer moved onto the line or its label block. Once per enter.

Parameters ​

e ​

LinePointerEvent<AlertLine>

Returns ​

void

Inherited from ​

LineInteractionOptions.onHover


onHoverEnd? ​

optional onHoverEnd?: () => void

Defined in: packages/core/src/annotations/types.ts:150

The pointer left the line and its block. Once per leave.

Returns ​

void

Inherited from ​

LineInteractionOptions.onHoverEnd


onRemove? ​

optional onRemove?: () => void

Defined in: packages/core/src/annotations/types.ts:387

The remove button was pressed. Without it, no button is shown.

Returns ​

void


price ​

price: number

Defined in: packages/core/src/annotations/types.ts:368


priceAxisLabel? ​

optional priceAxisLabel?: boolean

Defined in: packages/core/src/annotations/types.ts:162

The price label on the axis. Default true.

Inherited from ​

LineLabelOptions.priceAxisLabel


series? ​

optional series?: Series<object>

Defined in: packages/core/src/annotations/types.ts:379

Series whose price scale and pane the line follows. Default: the main series.


tickSize? ​

optional tickSize?: number

Defined in: packages/core/src/annotations/types.ts:381

Dragged prices snap to multiples of this. Default: one unit of the series precision.


title? ​

optional title?: string

Defined in: packages/core/src/annotations/types.ts:372

Optional text after the label, e.g. the alert's condition or a note.


tooltip? ​

optional tooltip?: string | string[]

Defined in: packages/core/src/annotations/types.ts:154

Text shown while hovering the line; several strings are several lines.

Inherited from ​

LineInteractionOptions.tooltip