Skip to main content

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:

  • getLeftPriceScales
  • getRightPriceScales
  • getMainSourcePriceScale

Methods

currency

currency(): CurrencyInfo

Returns the current currency info set on the price scale if any or null if none is specified

Returns

CurrencyInfo


getMode

getMode(): PriceScaleMode

Returns current mode of the price scale

Returns

PriceScaleMode


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

VisiblePriceRange


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

NameTypeDescription
isAutoScalebooleanset to true to enable auto scaling

Returns

void


setCurrency

setCurrency(currency): void

Sets a currency on the price scale.

Parameters

NameTypeDescription
currencystringcurrency 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

NameTypeDescription
isInvertedbooleanset 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

NameTypeDescription
isLockedbooleanset to true to lock the price scale

Returns

void


setMode

setMode(newMode): void

Changes current mode of the price scale

Parameters

NameTypeDescription
newModePriceScaleModenew mode to set for the price scale

Returns

void


setUnit

setUnit(unit): void

Sets a unit on the price scale.

Parameters

NameTypeDescription
unitstringunit 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

NameTypeDescription
rangeVisiblePriceRangean object with from and to, which are the boundaries of the price scale visible range.

Returns

void


unit

unit(): UnitInfo

Returns the current unit info set on the price scale if any or null if none is specified

Returns

UnitInfo