Skip to main content
Version: latest

IPositionLineAdapter

Interface

An API object used to control position lines.

Methods

getBodyBackgroundColor

Get the body font of the position line.

Signature

getBodyBackgroundColor() => string

Returns

string


getBodyBorderColor

Get the body border color of the position line.

Signature

getBodyBorderColor() => string

Returns

string


getBodyFont

Get the body font of the position line.

Signature

getBodyFont() => string

Returns

string


getBodyTextColor

Get the body text color of the position line.

Signature

getBodyTextColor() => string

Returns

string


getCloseButtonBackgroundColor

Get the close button background color of the position line.

Signature

getCloseButtonBackgroundColor() => string

Returns

string


getCloseButtonBorderColor

Get the close button border color of the position line.

Signature

getCloseButtonBorderColor() => string

Returns

string


getCloseButtonIconColor

Get the close button icon color of the position line.

Signature

getCloseButtonIconColor() => string

Returns

string


getCloseTooltip

Get the close tooltip of the position line.

Signature

getCloseTooltip() => string

Returns

string


getExtendLeft

Get the extend left flag value of the position line.

Signature

getExtendLeft() => boolean

Returns

boolean


getLineColor

Get the line color of the position line.

Signature

getLineColor() => string

Returns

string


getLineLength

Get the line length of the position line.

Signature

getLineLength() => number

Returns

number


getLineLengthUnit

Get the unit of length specified for the line length of the position line.

Signature

getLineLengthUnit() => PositionLineLengthUnit

Returns

PositionLineLengthUnit


getLineStyle

Get the line style of the position line.

Signature

getLineStyle() => number

Returns

number


getLineWidth

Get the line width of the position line.

Signature

getLineWidth() => number

Returns

number


getPrice

Get the price of the position line.

Signature

getPrice() => number

Returns

number


getProtectTooltip

Get the protect tooltip of the position line.

Signature

getProtectTooltip() => string

Returns

string


getQuantity

Get the quantity of the position line.

Signature

getQuantity() => string

Returns

string


getQuantityBackgroundColor

Get the quantity background color of the position line.

Signature

getQuantityBackgroundColor() => string

Returns

string


getQuantityBorderColor

Get the quantity border color of the position line.

Signature

getQuantityBorderColor() => string

Returns

string


getQuantityFont

Get the quantity font of the position line.

Signature

getQuantityFont() => string

Returns

string


getQuantityTextColor

Get the quantity text color of the position line.

Signature

getQuantityTextColor() => string

Returns

string


getReverseButtonBackgroundColor

Get the reverse button background color of the position line.

Signature

getReverseButtonBackgroundColor() => string

Returns

string


getReverseButtonBorderColor

Get the reverse button border color of the position line.

Signature

getReverseButtonBorderColor() => string

Returns

string


getReverseButtonIconColor

Get the reverse button icon color of the position line.

Signature

getReverseButtonIconColor() => string

Returns

string


getReverseTooltip

Get the reverse tooltip of the position line.

Signature

getReverseTooltip() => string

Returns

string


getText

Get the text of the position line.

Signature

getText() => string

Returns

string


getTooltip

Get the tooltip of the position line.

Signature

getTooltip() => string

Returns

string


onClose

Attach a callback to be executed when the position line is closed.

Signature

onClose(callback: Function) => this

Parameters

NameTypeDescription
callback() => voidCallback to be executed when the position line is closed.

Returns

this


Attach a callback to be executed when the position line is closed.

Signature

onClose<T>(data: T, callback: Function) => this

Type parameters

Name
T

Parameters

NameTypeDescription
dataTData to be passed to the callback.
callback(data: T) => voidCallback to be executed when the position line is closed.

Returns

this


onModify

Attach a callback to be executed when the position line is modified.

Signature

onModify(callback: Function) => this

Parameters

NameTypeDescription
callback() => voidCallback to be executed when the position line is modified.

Returns

this


Attach a callback to be executed when the position line is modified.

Signature

onModify<T>(data: T, callback: Function) => this

Type parameters

Name
T

Parameters

NameTypeDescription
dataTData to be passed to the callback.
callback(data: T) => voidCallback to be executed when the position line is modified.

Returns

this


onReverse

Attach a callback to be executed when the position line is reversed.

Signature

onReverse(callback: Function) => this

Parameters

NameTypeDescription
callback() => voidCallback to be executed when the position line is reversed.

Returns

this


Attach a callback to be executed when the position line is reversed.

Signature

onReverse<T>(data: T, callback: Function) => this

Type parameters

Name
T

Parameters

NameTypeDescription
dataTData to be passed to the callback.
callback(data: T) => voidCallback to be executed when the position line is reversed.

Returns

this


remove

Remove the position line. This API object cannot be used after this call.

Signature

remove() => void

Returns

void


setBodyBackgroundColor

Set the body font of the position line.

Signature

setBodyBackgroundColor(value: string) => this

Parameters

NameTypeDescription
valuestringThe new body font.

Returns

this


setBodyBorderColor

Set the body border color of the position line.

Signature

setBodyBorderColor(value: string) => this

Parameters

NameTypeDescription
valuestringThe new body border color.

Returns

this


setBodyFont

Set the body font of the position line.

Example

widget.activeChart().createPositionLine().setPrice(170).setBodyFont("bold 12px Verdana")

Signature

setBodyFont(value: string) => this

Parameters

NameTypeDescription
valuestringThe new body font.

Returns

this


setBodyTextColor

Set the body text color of the position line.

Signature

setBodyTextColor(value: string) => this

Parameters

NameTypeDescription
valuestringThe new body text color.

Returns

this


setCloseButtonBackgroundColor

Set the close button background color of the position line.

Signature

setCloseButtonBackgroundColor(value: string) => this

Parameters

NameTypeDescription
valuestringThe new close button background color.

Returns

this


setCloseButtonBorderColor

Set the close button border color of the position line.

Signature

setCloseButtonBorderColor(value: string) => this

Parameters

NameTypeDescription
valuestringThe new close button border color.

Returns

this


setCloseButtonIconColor

Set the close button icon color of the position line.

Signature

setCloseButtonIconColor(value: string) => this

Parameters

NameTypeDescription
valuestringThe new close button icon color.

Returns

this


setCloseTooltip

Set the close tooltip of the position line.

Signature

setCloseTooltip(value: string) => this

Parameters

NameTypeDescription
valuestringThe new close tooltip.

Returns

this


setExtendLeft

Set the extend left flag value of the position line.

Signature

setExtendLeft(value: boolean) => this

Parameters

NameTypeDescription
valuebooleanThe new extend left flag value.

Returns

this


setLineColor

Set the line color of the position line.

Signature

setLineColor(value: string) => this

Parameters

NameTypeDescription
valuestringThe new line color.

Returns

this


setLineLength

Set the line length of the position line.

If negative number is provided for the value and the unit is 'pixel' then the position will be relative to the left edge of the chart.

Signature

setLineLength(value: number, unit?: PositionLineLengthUnit) => this

Parameters

NameTypeDescription
valuenumberThe new line length.
unit?PositionLineLengthUnitunit for the line length, defaults to 'percentage'.

Returns

this


setLineStyle

Set the line style of the position line.

Signature

setLineStyle(value: number) => this

Parameters

NameTypeDescription
valuenumberThe new line style.

Returns

this


setLineWidth

Set the line width of the position line.

Signature

setLineWidth(value: number) => this

Parameters

NameTypeDescription
valuenumberThe new line width.

Returns

this


setPrice

Set the price of the position line.

Signature

setPrice(value: number) => this

Parameters

NameTypeDescription
valuenumberThe new price.

Returns

this


setProtectTooltip

Set the protect tooltip of the position line.

Signature

setProtectTooltip(value: string) => this

Parameters

NameTypeDescription
valuestringThe new protect tooltip.

Returns

this


setQuantity

Set the quantity of the position line.

Signature

setQuantity(value: string) => this

Parameters

NameTypeDescription
valuestringThe new quantity.

Returns

this


setQuantityBackgroundColor

Set the quantity background color of the position line.

Signature

setQuantityBackgroundColor(value: string) => this

Parameters

NameTypeDescription
valuestringThe new quantity background color.

Returns

this


setQuantityBorderColor

Set the quantity border color of the position line.

Signature

setQuantityBorderColor(value: string) => this

Parameters

NameTypeDescription
valuestringThe new quantity border color.

Returns

this


setQuantityFont

Set the quantity font of the position line.

Example

widget.activeChart().createPositionLine().setPrice(170).setQuantityFont("bold 12px Verdana")

Signature

setQuantityFont(value: string) => this

Parameters

NameTypeDescription
valuestringThe new quantity font.

Returns

this


setQuantityTextColor

Set the quantity text color of the position line.

Signature

setQuantityTextColor(value: string) => this

Parameters

NameTypeDescription
valuestringThe new quantity text color.

Returns

this


setReverseButtonBackgroundColor

Set the reverse button background color of the position line.

Signature

setReverseButtonBackgroundColor(value: string) => this

Parameters

NameTypeDescription
valuestringThe new reverse button background color.

Returns

this


setReverseButtonBorderColor

Set the reverse button border color of the position line.

Signature

setReverseButtonBorderColor(value: string) => this

Parameters

NameTypeDescription
valuestringThe new reverse button border color.

Returns

this


setReverseButtonIconColor

Set the reverse button icon color of the position line.

Signature

setReverseButtonIconColor(value: string) => this

Parameters

NameTypeDescription
valuestringThe new reverse button icon color.

Returns

this


setReverseTooltip

Set the reverse tooltip of the position line.

Signature

setReverseTooltip(value: string) => this

Parameters

NameTypeDescription
valuestringThe new reverse tooltip.

Returns

this


setText

Set the text of the position line.

Signature

setText(value: string) => this

Parameters

NameTypeDescription
valuestringThe new text.

Returns

this


setTooltip

Set the tooltip of the position line.

Signature

setTooltip(value: string) => this

Parameters

NameTypeDescription
valuestringThe new tooltip.

Returns

this