Interface: IPriceScaleApi
Charting Library.IPriceScaleApi
The Price Scale API allows interacting with the price scale. You can retrieve this interface by evoking the following methods of the IPaneApi:
getLeftPriceScalesgetRightPriceScalesgetMainSourcePriceScale
Methods
currency
▸ currency(): CurrencyInfo
Returns the current currency set on the price scale. Returns null if no currency is specified.
Returns
getMode
▸ getMode(): PriceScaleMode
Returns current mode of the price scale
Returns
getStudies
▸ getStudies(): EntityId[]
Returns an array of IDs of all studies attached to the price scale
Returns
EntityId[]
getVisiblePriceRange
▸ getVisiblePriceRange(): VisiblePriceRange
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.
Returns
hasMainSeries
▸ hasMainSeries(): boolean
Returns true if the price scale contains the main series
Returns
boolean
isAutoScale
▸ isAutoScale(): boolean
Returns true when the price scale has auto scaling enabled
Returns
boolean
isInverted
▸ isInverted(): boolean
Returns whether the price scale is inverted or not
Returns
boolean
isLocked
▸ isLocked(): boolean
Returns true when the price scale is locked
Returns
boolean
setAutoScale
▸ setAutoScale(isAutoScale): void
Set whether auto scaling should be enabled or not for the price scale
Parameters
| Name | Type | Description |
|---|---|---|
isAutoScale | boolean | set to true to enable auto scaling |
Returns
void
setCurrency
▸ setCurrency(currency): void
Sets a currency on the price scale.
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
▸ setInverted(isInverted): void
Changes current inverted state of the price scale
Parameters
| Name | Type | Description |
|---|---|---|
isInverted | boolean | set to true if the price scale should become inverted |
Returns
void
setLocked
▸ setLocked(isLocked): void
Set whether the price scale should be locked or not
Parameters
| Name | Type | Description |
|---|---|---|
isLocked | boolean | set to true to lock the price scale |
Returns
void
setMode
▸ setMode(newMode): void
Changes current mode of the price scale
Parameters
| Name | Type | Description |
|---|---|---|
newMode | PriceScaleMode | new mode to set for the price scale |
Returns
void
setUnit
▸ setUnit(unit): void
Sets a unit on the price scale.
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
▸ setVisiblePriceRange(range): void
Sets current visible price range of the price scale,
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
▸ unit(): UnitInfo
Returns the current unit set on the price scale. Returns null if no unit is specified.