Package
caplin.chart.highchart

RangeUtility

A static utility class for dealing with HighChart's range selector.

Constructor Summary

Attributes Name and Description
caplin.chart.highchart.RangeUtility()

This is a static class that never needs to be instantiated.

Method Summary

Attributes Name and Description
<static> void applyOptions(Object chart, Map options)

Applies the range options to the HighChart chart instance.

<static> Map getOptions(Object chart)

Returns a options map with information about which range selector button is selected or what are the extremes currently set in the navigator.

Constructor Detail

caplin.chart.highchart.RangeUtility()

This is a static class that never needs to be instantiated.

Method Detail

<static> void applyOptions(Object chart, Map options)

Applies the range options to the HighChart chart instance.

Parameters
Object chart A HighChart chart instance.
Map options A map with selected options. See caplin.chart.highchart.RangeUtility#getOptions to learn the structure of this map.

<static> Map getOptions(Object chart)

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 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
Object chart A HighChart chart instance.
Returns
{Map} A map with the selected options.