Caplin Trader 4.7.1

Class: module:caplin/chart/highchart/RangeUtility

module:caplin/chart/highchart/RangeUtility

Constructor

new module:caplin/chart/highchart/RangeUtility()

A static utility class for dealing with HighChart's range selector. This is a static class that never needs to be instantiated.

Methods

(static) applyOptions(chart, options)

Applies the range options to the HighChart chart instance.
Parameters:
Name Type Description
chart Object A HighChart chart instance.
options Map A map with selected options. See module:caplin/chart/highchart/RangeUtility.getOptions to learn the structure of this map.

(static) getOptions(chart) → {Map}

Returns a options map with information about which range selector button is selected or what are the extremes currently set in the navigator. The result of this method can be passed into module:caplin/chart/highchart/RangeUtility.applyOptions to re-apply the options (after deserialisation for example).

The returned map will always have the following structure:

{
  selectedRangeSelector: null,
  extremes: {
    relativeMin: null,
    relativeMax: null
  }
}

Note that if selectedRangeSelector is not null then the extremes values will be null, and the other way around. They can however both be null.

Parameters:
Name Type Description
chart Object A HighChart chart instance.
Returns:
A map with the selected options.
Type
Map