Constructor
new module:caplin/chart/Series(seriesRequest, chartSeriesAdapter)
Constructs a new
caplin.chart.Series
.
Parameters:
Name | Type | Description |
---|---|---|
seriesRequest |
Object | A SeriesRequest object that defines the data request. |
chartSeriesAdapter |
Object | A Adapter object that transforms the series data
into an acceptable format for the chart engine in use. |
Methods
-
addListener(listener)
-
Adds a listener for series events.
Parameters:
Name Type Description listener
module:caplin/chart/series/SeriesListener The listener that will receive series data. -
addStudy(studyAlias, derivationParams, configOverridesopt, studyAdapteropt) → {module:caplin/chart/Study}
-
Adds a study to this series.
Parameters:
Name Type Attributes Description studyAlias
String The study alias, to be retrieved from the AliasRegistry. derivationParams
Object An object literal containing the options for the study. configOverrides
Object <optional>
Configuration passed from the descendant class upon instantiation. studyAdapter
module:caplin/chart/study/Adaptor <optional>
The adaptor to pass the study data through before passing it onto the Chart
.Throws:
-
if the study already exists in the series.
Returns:
The newly constructed study. -
-
addStudyListener(listener)
-
Adds a listener for study events.
Parameters:
Name Type Description listener
module:caplin/chart/series/StudyListener The listener that will receive study data. -
dispose()
-
This method disposes the
caplin.chart.Series
object. It must be called to properly close subscriptions. -
getData() → {Array.<Array.<Number>>}
-
Return a copy of the data received from the backend for this series or null if no data has been received or series.dispose() was called
Returns:
A copy of the data received from the backend- Type
- Array.<Array.<Number>>
-
getSeriesRequest() → {module:caplin/chart/series/SeriesRequest}
-
Returns a
SeriesRequest
object that was passed to the constructor.Returns:
ARequest
object. -
getStudy(studyId) → {module:caplin/chart/Study}
-
Gets the study object.
Parameters:
Name Type Description studyId
String The study ID you want to retrieve. Returns:
The study if found, otherwise undefined. -
removeStudy(studyId)
-
Removes a study from the series.
Parameters:
Name Type Description studyId
String The ID of the study to remove. Throws:
-
if the study does not exist in the series.
-