Class
caplin.chart

Series

The Series manages data fetching from a backend system using the service aliased by caplin.chart-service. Its primary purpose is to provide a study management mechanism.

Chart components construct a new caplin.chart.Series object (passing it a caplin.chart.series.SeriesRequest which describes the type of data to request) when they wish to request new chart series data to display. If a chart component is using this class it has to implement a caplin.chart.series.SeriesListener interface that defines the callback methods that this class will call when it has the chart data to pass on.

Constructor Summary

Attributes Name and Description
caplin.chart.Series(Object oSeriesRequest, Object oListener, Object oChartSeriesAdapter)

Constructs a new caplin.chart.Series.

Method Summary

Attributes Name and Description
Object addStudy(String sStudyAlias, Object mDerivationParams, Object mConfigOverrides, Object oStudyAdapter)

Adds a study to this series.

void dispose()

This method disposes the caplin.chart.Series object.

Object getSeriesRequest()

Returns a caplin.chart.series.SeriesRequest object that was passed to the constructor.

Object getStudy(String sStudyId)

Gets the study object.

void removeStudy(String sStudyId)

Removes a study from the series.

void serialize()

private

Methods implemented from class caplin.chart.service.ChartServiceListener:
onSeriesData, onSeriesDataSubscriptionError, onSeriesDataSubscriptionStatus
Methods implemented from class caplin.chart.study.StudyListener:
onStudyData

Constructor Detail

caplin.chart.Series(Object oSeriesRequest, Object oListener, Object oChartSeriesAdapter)

Constructs a new caplin.chart.Series.

Parameters
Object oSeriesRequest A caplin.chart.series.SeriesRequest object that determines what data you are requesting from the backend.
Object oListener A caplin.chart.series.SeriesListener that will receive chart data.
Object oChartSeriesAdapter A caplin.chart.series.Adapter object that transforms the series data into an understandable format for the chart engine in use.

Method Detail

Object addStudy(String sStudyAlias, Object mDerivationParams, Object mConfigOverrides, Object oStudyAdapter)

Adds a study to this series.

Parameters
String sStudyAlias The study alias, to be retrieved from the AliasRegistry.
Object mDerivationParams An object literal containing the options for the study.
Object mConfigOverrides (optional) Configuration passed from the descendant class upon instantiation.
Object oStudyAdapter (optional) caplin.chart.study.Adapter to pass the study data through before passing it onto the caplin.chart.Chart.
Throws
caplin.core.Error
if the study already exists in the series.
Returns
{Object} The newly constructed study.

void dispose()

This method disposes the caplin.chart.Series object. It must be called to properly close subscriptions.

Object getSeriesRequest()

Returns a caplin.chart.series.SeriesRequest object that was passed to the constructor.

Returns
{Object} A Request object.

Object getStudy(String sStudyId)

Gets the study object.

Parameters
String sStudyId The study ID you want to retrieve.
Returns
{Object} The study if found, otherwise undefined.

void removeStudy(String sStudyId)

Removes a study from the series.

Parameters
String sStudyId The ID of the study to remove.
Throws
caplin.core.Error
if the study does not exist in the series.

void serialize()

private