Skip to main content

IPriceScaleApi

Interface

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 set on the price scale. Returns null if no currency is specified.

Signature

currency() => CurrencyInfo

Returns

CurrencyInfo


getMode

Returns current mode of the price scale

Signature

getMode() => PriceScaleMode

Returns

PriceScaleMode


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

VisiblePriceRange


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

NameTypeDescription
isAutoScalebooleanset to true to enable auto scaling

Returns

void


setCurrency

Sets a currency on the price scale.

Signature

setCurrency(currency: string) => void

Parameters

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

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

NameTypeDescription
isLockedbooleanset to true to lock the price scale

Returns

void


setMode

Changes current mode of the price scale

Signature

setMode(newMode: PriceScaleMode) => void

Parameters

NameTypeDescription
newModePriceScaleModenew mode to set for the price scale

Returns

void


setUnit

Sets a unit on the price scale.

Signature

setUnit(unit: string) => void

Parameters

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

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

Returns

void


unit

Returns the current unit set on the price scale. Returns null if no unit is specified.

Signature

unit() => UnitInfo

Returns

UnitInfo