IPriceScaleApi
The Price Scale API allows interacting with the price scale. You can retrieve this interface by evoking the following methods of the IPaneApi:
getLeftPriceScales
getRightPriceScales
getMainSourcePriceScale
Methods
currency
Returns the current currency info set on the price scale if any or null if none is specified
Signature
currency() => CurrencyInfo
Returns
getMode
Returns current mode of the price scale
Signature
getMode() => PriceScaleMode
Returns
getStudies
Returns an array of IDs of all studies attached to the price scale
Signature
getStudies() => EntityId[]
Returns
EntityId[]
getVisiblePriceRange
Returns current visible price range of the price scale.
The result is an object with from
and to
,
which are the boundaries of the price scale visible range.
Signature
getVisiblePriceRange() => VisiblePriceRange
Returns
hasMainSeries
Returns true
if the price scale contains the main series
Signature
hasMainSeries() => boolean
Returns
boolean
isAutoScale
Returns true
when the price scale has auto scaling enabled
Signature
isAutoScale() => boolean
Returns
boolean
isInverted
Returns whether the price scale is inverted or not
Signature
isInverted() => boolean
Returns
boolean
isLocked
Returns true
when the price scale is locked
Signature
isLocked() => boolean
Returns
boolean
setAutoScale
Set whether auto scaling should be enabled or not for the price scale
Signature
setAutoScale(isAutoScale: boolean) => void
Parameters
Name | Type | Description |
---|---|---|
isAutoScale | boolean | set to true to enable auto scaling |
Returns
void
setCurrency
Sets a currency on the price scale.
Signature
setCurrency(currency: string) => void
Parameters
Name | Type | Description |
---|---|---|
currency | string | currency supported by your backend (for example 'EUR', 'USD'). A null value will reset the currency to default. |
Returns
void
setInverted
Changes current inverted state of the price scale
Signature
setInverted(isInverted: boolean) => void
Parameters
Name | Type | Description |
---|---|---|
isInverted | boolean | set to true if the price scale should become inverted |
Returns
void
setLocked
Set whether the price scale should be locked or not
Signature
setLocked(isLocked: boolean) => void
Parameters
Name | Type | Description |
---|---|---|
isLocked | boolean | set to true to lock the price scale |
Returns
void
setMode
Changes current mode of the price scale
Signature
setMode(newMode: PriceScaleMode) => void
Parameters
Name | Type | Description |
---|---|---|
newMode | PriceScaleMode | new mode to set for the price scale |
Returns
void
setUnit
Sets a unit on the price scale.
Signature
setUnit(unit: string) => void
Parameters
Name | Type | Description |
---|---|---|
unit | string | unit supported by your backend (for example 'weight', 'energy'). A null value will reset the unit to default. |
Returns
void
setVisiblePriceRange
Sets current visible price range of the price scale,
Signature
setVisiblePriceRange(range: VisiblePriceRange) => void
Parameters
Name | Type | Description |
---|---|---|
range | VisiblePriceRange | an object with from and to , which are the boundaries of the price scale visible range. |
Returns
void
unit
Returns the current unit info set on the price scale if any or null if none is specified
Signature
unit() => UnitInfo