Caplin Trader 5.1.0

Class: module:ct-chart/series/SeriesManager

module:ct-chart/series/SeriesManager()

new module:ct-chart/series/SeriesManager()

Constructs a new SeriesManager.

A class to help you manage module:ct-chart/Series objects.

Methods

add(seriesId, series)

Adds a module:ct-chart/Series to the manager.

Parameters:
Name Type Description
seriesId String

The ID of the series.

series module:ct-chart/Series

The series object to store.

Throws:

If series is not an instance of module:ct-chart/Series.

Type
module:ct-core/Error

dispose(seriesIdToRetainopt)

Disposes of all module:ct-chart/Series objects stored in this manager. It will call module:ct-chart/Series#dispose on each object before removing it.

Parameters:
Name Type Attributes Description
seriesIdToRetain String <optional>

If set, the series object with this ID will not be removed.

getAll() → {Array}

Returns all module:ct-chart/Series objects in this manager.

Returns:
Type
Array

getById(seriesId) → {module:ct-chart/Series|null}

Returns a module:ct-chart/Series object if found in the manager, null otherwise.

Parameters:
Name Type Description
seriesId String

ID of the series.

Returns:
Type
module:ct-chart/Series | null

getCount() → {Number}

Returns the number of module:ct-chart/Series objects in this manager.

Returns:
Type
Number

remove(seriesId, disposeopt)

Removes the module:ct-chart/Series object from the manager. By default it will first call module:ct-chart/Series#dispose on the series object.

Parameters:
Name Type Attributes Default Description
seriesId String

ID of the series to remove

dispose Boolean <optional>
true

Call dispose on the series object before removing it.

serialize() → {String}

Returns a XML representation of all the series stored in this manager. This method will call module:ct-chart/Series#serialize on each stored series object.

Returns:
Type
String