Caplin Trader 4.8.0

Class: module:caplin/chart/highchart/SeriesUtility

module:caplin/chart/highchart/SeriesUtility

Constructor

new module:caplin/chart/highchart/SeriesUtility(highChartSeries)

Constructs a new caplin.chart.highchart.SeriesUtility. A utility class to manage some common operations on a HighChart series object.
Parameters:
Name Type Description
highChartSeries Object A HighChart series object.

Methods

addTicks(periods, completionCallback) → {Boolean}

Adds periods to a HighChart series.
Parameters:
Name Type Description
periods Array An array of periods in the Caplin chart format.
completionCallback function A function that runs once the periods have been processed.
Returns:
Returns true if the chart needs to be redrawn after calling this method, false otherwise.
Type
Boolean

getPointByTimestamp(timestamp) → {Object|null|undefined}

Finds a HighChart point object based on the timestamp.

Note that if dataGrouping is enabled, or if the chart is zoomed or panned so that it's not showing the point being searched for, this won't return the Point object, even if it was returned in one of the previous calls to this method.

Parameters:
Name Type Description
timestamp Number The timestamp to searh for.
Returns:
If the Point object is found it will return it. If the HighChart series already has a period with this timestamp, but hasn't yet created the Point object undefined will be returned. If however the timestamp is part of a new period, null will be returned.
Type
Object | null | undefined

setPointValue(periodData) → {Boolean}

Adds a new point to a series or updates an existing one if it is already present on the series.
Parameters:
Name Type Description
periodData Object A series period data in the Caplin chart format.
Returns:
Returns true if the chart needs to be redrawn after calling this method, false otherwise.
Type
Boolean