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
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
| Name | Type | Description |
|---|---|---|
callback | () => void | Callback to be executed when the position line is closed. |
Returns
onClose<T>(data, callback): IPositionLineAdapter
Attach a callback to be executed when the position line is closed.
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
data | T | Data to be passed to the callback. |
callback | (data: T) => void | Callback to be executed when the position line is closed. |
Returns
onModify
onModify(callback): IPositionLineAdapter
Attach a callback to be executed when the position line is modified.
Parameters
| Name | Type | Description |
|---|---|---|
callback | () => void | Callback to be executed when the position line is modified. |
Returns
onModify<T>(data, callback): IPositionLineAdapter
Attach a callback to be executed when the position line is modified.
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
data | T | Data to be passed to the callback. |
callback | (data: T) => void | Callback to be executed when the position line is modified. |
Returns
onReverse
onReverse(callback): IPositionLineAdapter
Attach a callback to be executed when the position line is reversed.
Parameters
| Name | Type | Description |
|---|---|---|
callback | () => void | Callback to be executed when the position line is reversed. |
Returns
onReverse<T>(data, callback): IPositionLineAdapter
Attach a callback to be executed when the position line is reversed.
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
data | T | Data to be passed to the callback. |
callback | (data: T) => void | Callback to be executed when the position line is reversed. |
Returns
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
| Name | Type | Description |
|---|---|---|
value | string | A color string in RGBA format for the body background color (e.g., "rgba(255, 0, 0, 0.5)"). |
Returns
setBodyBorderColor
setBodyBorderColor(value): IPositionLineAdapter
Set the body border color of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new body border color. |
Returns
setBodyFont
setBodyFont(value): IPositionLineAdapter
Set the body font of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new body font. |
Returns
Example
positionLine.setPrice(170).setBodyFont("bold 12px Verdana")
setBodyTextColor
setBodyTextColor(value): IPositionLineAdapter
Set the body text color of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | A simple color string for the body text (e.g., "red", "#FF0000"). |
Returns
setCloseButtonBackgroundColor
setCloseButtonBackgroundColor(value): IPositionLineAdapter
Set the close button background color of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new close button background color. |
Returns
setCloseButtonBorderColor
setCloseButtonBorderColor(value): IPositionLineAdapter
Set the close button border color of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new close button border color. |
Returns
setCloseButtonIconColor
setCloseButtonIconColor(value): IPositionLineAdapter
Set the close button icon color of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new close button icon color. |
Returns
setCloseTooltip
setCloseTooltip(value): IPositionLineAdapter
Set the close tooltip of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new close tooltip. |
Returns
setExtendLeft
setExtendLeft(value): IPositionLineAdapter
Set the extend left flag value of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | boolean | The new extend left flag value. |
Returns
setLineColor
setLineColor(value): IPositionLineAdapter
Set the line color of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new line color. |
Returns
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
| Name | Type | Description |
|---|---|---|
value | number | The new line length. |
unit? | PositionLineLengthUnit | unit for the line length, defaults to 'percentage'. |
Returns
setLineStyle
setLineStyle(value): IPositionLineAdapter
Set the line style of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | number | The new line style. |
Returns
setLineWidth
setLineWidth(value): IPositionLineAdapter
Set the line width of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | number | The new line width. |
Returns
setPrice
setPrice(value): IPositionLineAdapter
Set the price of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | number | The new price. |
Returns
setProtectTooltip
setProtectTooltip(value): IPositionLineAdapter
Set the protect tooltip of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new protect tooltip. |
Returns
setQuantity
setQuantity(value): IPositionLineAdapter
Set the quantity of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new quantity. |
Returns
setQuantityBackgroundColor
setQuantityBackgroundColor(value): IPositionLineAdapter
Set the quantity background color of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new quantity background color. |
Returns
setQuantityBorderColor
setQuantityBorderColor(value): IPositionLineAdapter
Set the quantity border color of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new quantity border color. |
Returns
setQuantityFont
setQuantityFont(value): IPositionLineAdapter
Set the quantity font of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new quantity font. |
Returns
Example
positionLine.setPrice(170).setQuantityFont("bold 12px Verdana")
setQuantityTextColor
setQuantityTextColor(value): IPositionLineAdapter
Set the quantity text color of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | A color string in RGBA format (e.g., "rgba(255, 0, 0, 0.5)"). |
Returns
setReverseButtonBackgroundColor
setReverseButtonBackgroundColor(value): IPositionLineAdapter
Set the reverse button background color of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | A color string in RGBA format for the reverse button background color (e.g., "rgba(255, 0, 0, 0.5)"). |
Returns
setReverseButtonBorderColor
setReverseButtonBorderColor(value): IPositionLineAdapter
Set the reverse button border color of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new reverse button border color. |
Returns
setReverseButtonIconColor
setReverseButtonIconColor(value): IPositionLineAdapter
Set the reverse button icon color of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new reverse button icon color. |
Returns
setReverseTooltip
setReverseTooltip(value): IPositionLineAdapter
Set the reverse tooltip of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new reverse tooltip. |
Returns
setText
setText(value): IPositionLineAdapter
Set the text of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new text. |
Returns
setTooltip
setTooltip(value): IPositionLineAdapter
Set the tooltip of the position line.
Parameters
| Name | Type | Description |
|---|---|---|
value | string | The new tooltip. |