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.

Classes that wish to be notified of a series's events must implement the caplin.chart.series.SeriesListener interface and register themselves as a listener to that series.

Classes that wish to be notified of a series's study events must implement the caplin.chart.series.StudyListener interface and register themselves as a listener to that series.

Constructor Summary

Attributes Name and Description
caplin.chart.Series(Object seriesRequest, Object chartSeriesAdapter)

Constructs a new caplin.chart.Series.

Method Summary

Attributes Name and Description
void addListener(caplin.chart.series.SeriesListener listener)

Adds a listener for series events.

caplin.chart.Study addStudy(String studyAlias, Object derivationParams, Object configOverrides, caplin.chart.study.Adapter studyAdapter)

Adds a study to this series.

void addStudyListener(caplin.chart.series.StudyListener listener)

Adds a listener for study events.

void dispose()

This method disposes the caplin.chart.Series object.

caplin.chart.series.SeriesRequest getSeriesRequest()

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

caplin.chart.Study getStudy(String studyId)

Gets the study object.

void removeStudy(String studyId)

Removes a study from the series.

void serialize()

private

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

Constructor Detail

caplin.chart.Series(Object seriesRequest, Object chartSeriesAdapter)

Constructs a new caplin.chart.Series.

Parameters
Object seriesRequest A caplin.chart.series.SeriesRequest object that determines what data you are requesting from the backend.
Object chartSeriesAdapter A caplin.chart.series.Adapter object that transforms the series data into an understandable format for the chart engine in use.

Method Detail

void addListener(caplin.chart.series.SeriesListener listener)

Adds a listener for series events.

Parameters
caplin.chart.series.SeriesListener listener The listener that will receive series data.

caplin.chart.Study addStudy(String studyAlias, Object derivationParams, Object configOverrides, caplin.chart.study.Adapter studyAdapter)

Adds a study to this series.

Parameters
String studyAlias The study alias, to be retrieved from the AliasRegistry.
Object derivationParams An object literal containing the options for the study.
Object configOverrides (optional) Configuration passed from the descendant class upon instantiation.
caplin.chart.study.Adapter studyAdapter (optional) The adaptor 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
{caplin.chart.Study} The newly constructed study.

void addStudyListener(caplin.chart.series.StudyListener listener)

Adds a listener for study events.

Parameters
caplin.chart.series.StudyListener listener The listener that will receive study data.

void dispose()

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

caplin.chart.series.SeriesRequest getSeriesRequest()

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

Returns
{caplin.chart.series.SeriesRequest} A Request object.

caplin.chart.Study getStudy(String studyId)

Gets the study object.

Parameters
String studyId The study ID you want to retrieve.
Returns
{caplin.chart.Study} The study if found, otherwise undefined.

void removeStudy(String studyId)

Removes a study from the series.

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

void serialize()

private