Skip to main content

Interface: IPositionLineAdapter

Charting Library.IPositionLineAdapter

An API object that controls position lines created with IChartWidgetApi.createPositionLine. For more information, refer to Trading primitives.

Methods​

getBodyBackgroundColor​

getBodyBackgroundColor(): string

Get the body background color of the position line.

Returns​

string


getBodyBorderColor​

getBodyBorderColor(): string

Get the body border color of the position line.

Returns​

string


getBodyFont​

getBodyFont(): string

Get the body font of the position line.

Returns​

string


getBodyTextColor​

getBodyTextColor(): string

Get the body text color of the position line.

Returns​

string


getCloseButtonBackgroundColor​

getCloseButtonBackgroundColor(): string

Get the close button background color of the position line.

Returns​

string


getCloseButtonBorderColor​

getCloseButtonBorderColor(): string

Get the close button border color of the position line.

Returns​

string


getCloseButtonIconColor​

getCloseButtonIconColor(): string

Get the close button icon color of the position line.

Returns​

string


getCloseTooltip​

getCloseTooltip(): string

Get the close tooltip of the position line.

Returns​

string


getExtendLeft​

getExtendLeft(): boolean

Get the extend left flag value of the position line.

Returns​

boolean


getLineColor​

getLineColor(): string

Get the line color of the position line.

Returns​

string


getLineLength​

getLineLength(): number

Get the line length of the position line.

Returns​

number


getLineLengthUnit​

getLineLengthUnit(): PositionLineLengthUnit

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

Returns​

PositionLineLengthUnit


getLineStyle​

getLineStyle(): number

Get the line style of the position line.

Returns​

number


getLineWidth​

getLineWidth(): number

Get the line width of the position line.

Returns​

number


getPrice​

getPrice(): number

Get the price of the position line.

Returns​

number


getProtectTooltip​

getProtectTooltip(): string

Get the protect tooltip of the position line.

Returns​

string


getQuantity​

getQuantity(): string

Get the quantity of the position line.

Returns​

string


getQuantityBackgroundColor​

getQuantityBackgroundColor(): string

Get the quantity background color of the position line.

Returns​

string


getQuantityBorderColor​

getQuantityBorderColor(): string

Get the quantity border color of the position line.

Returns​

string


getQuantityFont​

getQuantityFont(): string

Get the quantity font of the position line.

Returns​

string


getQuantityTextColor​

getQuantityTextColor(): string

Get the quantity text color of the position line.

Returns​

string


getReverseButtonBackgroundColor​

getReverseButtonBackgroundColor(): string

Get the reverse button background color of the position line.

Returns​

string


getReverseButtonBorderColor​

getReverseButtonBorderColor(): string

Get the reverse button border color of the position line.

Returns​

string


getReverseButtonIconColor​

getReverseButtonIconColor(): string

Get the reverse button icon color of the position line.

Returns​

string


getReverseTooltip​

getReverseTooltip(): string

Get the reverse tooltip of the position line.

Returns​

string


getText​

getText(): string

Get the text of the position line.

Returns​

string


getTooltip​

getTooltip(): string

Get the tooltip of the position line.

Returns​

string


onClose​

onClose(callback): IPositionLineAdapter

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

Parameters​

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

Returns​

IPositionLineAdapter

onClose<T>(data, callback): IPositionLineAdapter

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

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​

IPositionLineAdapter


onModify​

onModify(callback): IPositionLineAdapter

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

Parameters​

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

Returns​

IPositionLineAdapter

onModify<T>(data, callback): IPositionLineAdapter

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

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​

IPositionLineAdapter


onReverse​

onReverse(callback): IPositionLineAdapter

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

Parameters​

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

Returns​

IPositionLineAdapter

onReverse<T>(data, callback): IPositionLineAdapter

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

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​

IPositionLineAdapter


remove​

remove(): void

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


setBodyBackgroundColor​

setBodyBackgroundColor(value): IPositionLineAdapter

Set the body background color of the position line.

Parameters​

NameTypeDescription
valuestringA color string in RGBA format for the body background color (e.g., "rgba(255, 0, 0, 0.5)").

Returns​

IPositionLineAdapter


setBodyBorderColor​

setBodyBorderColor(value): IPositionLineAdapter

Set the body border color of the position line.

Parameters​

NameTypeDescription
valuestringThe new body border color.

Returns​

IPositionLineAdapter


setBodyFont​

setBodyFont(value): IPositionLineAdapter

Set the body font of the position line.

Parameters​

NameTypeDescription
valuestringThe new body font.

Returns​

IPositionLineAdapter

positionLine.setPrice(170).setBodyFont("bold 12px Verdana")

setBodyTextColor​

setBodyTextColor(value): IPositionLineAdapter

Set the body text color of the position line.

Parameters​

NameTypeDescription
valuestringA simple color string for the body text (e.g., "red", "#FF0000").

Returns​

IPositionLineAdapter


setCloseButtonBackgroundColor​

setCloseButtonBackgroundColor(value): IPositionLineAdapter

Set the close button background color of the position line.

Parameters​

NameTypeDescription
valuestringThe new close button background color.

Returns​

IPositionLineAdapter


setCloseButtonBorderColor​

setCloseButtonBorderColor(value): IPositionLineAdapter

Set the close button border color of the position line.

Parameters​

NameTypeDescription
valuestringThe new close button border color.

Returns​

IPositionLineAdapter


setCloseButtonIconColor​

setCloseButtonIconColor(value): IPositionLineAdapter

Set the close button icon color of the position line.

Parameters​

NameTypeDescription
valuestringThe new close button icon color.

Returns​

IPositionLineAdapter


setCloseTooltip​

setCloseTooltip(value): IPositionLineAdapter

Set the close tooltip of the position line.

Parameters​

NameTypeDescription
valuestringThe new close tooltip.

Returns​

IPositionLineAdapter


setExtendLeft​

setExtendLeft(value): IPositionLineAdapter

Set the extend left flag value of the position line.

Parameters​

NameTypeDescription
valuebooleanThe new extend left flag value.

Returns​

IPositionLineAdapter


setLineColor​

setLineColor(value): IPositionLineAdapter

Set the line color of the position line.

Parameters​

NameTypeDescription
valuestringThe new line color.

Returns​

IPositionLineAdapter


setLineLength​

setLineLength(value, unit?): IPositionLineAdapter

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.

Parameters​

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

Returns​

IPositionLineAdapter


setLineStyle​

setLineStyle(value): IPositionLineAdapter

Set the line style of the position line.

Parameters​

NameTypeDescription
valuenumberThe new line style.

Returns​

IPositionLineAdapter


setLineWidth​

setLineWidth(value): IPositionLineAdapter

Set the line width of the position line.

Parameters​

NameTypeDescription
valuenumberThe new line width.

Returns​

IPositionLineAdapter


setPrice​

setPrice(value): IPositionLineAdapter

Set the price of the position line.

Parameters​

NameTypeDescription
valuenumberThe new price.

Returns​

IPositionLineAdapter


setProtectTooltip​

setProtectTooltip(value): IPositionLineAdapter

Set the protect tooltip of the position line.

Parameters​

NameTypeDescription
valuestringThe new protect tooltip.

Returns​

IPositionLineAdapter


setQuantity​

setQuantity(value): IPositionLineAdapter

Set the quantity of the position line.

Parameters​

NameTypeDescription
valuestringThe new quantity.

Returns​

IPositionLineAdapter


setQuantityBackgroundColor​

setQuantityBackgroundColor(value): IPositionLineAdapter

Set the quantity background color of the position line.

Parameters​

NameTypeDescription
valuestringThe new quantity background color.

Returns​

IPositionLineAdapter


setQuantityBorderColor​

setQuantityBorderColor(value): IPositionLineAdapter

Set the quantity border color of the position line.

Parameters​

NameTypeDescription
valuestringThe new quantity border color.

Returns​

IPositionLineAdapter


setQuantityFont​

setQuantityFont(value): IPositionLineAdapter

Set the quantity font of the position line.

Parameters​

NameTypeDescription
valuestringThe new quantity font.

Returns​

IPositionLineAdapter

positionLine.setPrice(170).setQuantityFont("bold 12px Verdana")

setQuantityTextColor​

setQuantityTextColor(value): IPositionLineAdapter

Set the quantity text color of the position line.

Parameters​

NameTypeDescription
valuestringA color string in RGBA format (e.g., "rgba(255, 0, 0, 0.5)").

Returns​

IPositionLineAdapter


setReverseButtonBackgroundColor​

setReverseButtonBackgroundColor(value): IPositionLineAdapter

Set the reverse button background color of the position line.

Parameters​

NameTypeDescription
valuestringA color string in RGBA format for the reverse button background color (e.g., "rgba(255, 0, 0, 0.5)").

Returns​

IPositionLineAdapter


setReverseButtonBorderColor​

setReverseButtonBorderColor(value): IPositionLineAdapter

Set the reverse button border color of the position line.

Parameters​

NameTypeDescription
valuestringThe new reverse button border color.

Returns​

IPositionLineAdapter


setReverseButtonIconColor​

setReverseButtonIconColor(value): IPositionLineAdapter

Set the reverse button icon color of the position line.

Parameters​

NameTypeDescription
valuestringThe new reverse button icon color.

Returns​

IPositionLineAdapter


setReverseTooltip​

setReverseTooltip(value): IPositionLineAdapter

Set the reverse tooltip of the position line.

Parameters​

NameTypeDescription
valuestringThe new reverse tooltip.

Returns​

IPositionLineAdapter


setText​

setText(value): IPositionLineAdapter

Set the text of the position line.

Parameters​

NameTypeDescription
valuestringThe new text.

Returns​

IPositionLineAdapter


setTooltip​

setTooltip(value): IPositionLineAdapter

Set the tooltip of the position line.

Parameters​

NameTypeDescription
valuestringThe new tooltip.

Returns​

IPositionLineAdapter