Constructor
(abstract) new module:ct-chart /Study(alias, derivation Params, listener, config Overridesopt)
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
alias |
String | The Study alias. |
||||||||||||||||||||||||||||||||||||||||||||||
derivationParams |
Object | Options that the study will use to determine how to calculate the study series
data. This will usually be at least |
||||||||||||||||||||||||||||||||||||||||||||||
listener |
Object | A listener object that implements the |
||||||||||||||||||||||||||||||||||||||||||||||
configOverrides |
Object |
<optional> |
The configuration options for the study. Properties
|
Methods
enqueue(data, idx, arr)
Enqueues processed study data, which is then batch forwarded to the listener.
Performance optimisation for older browsers.
This method is only to be called by the Study by methods #evaluate or #onStudyData.
Parameters:
Name | Type | Description |
---|---|---|
data |
Array | The latest value array from the Study. |
idx |
Number | The current values index within the studies current data set. |
arr |
Array | The data that the Study is currently evaluating. |
evaluate(data)
This method will get called by the module:ct-chart/Series
every time it receives new chart data. This method
should perform its calculations and then pass the calculated data to the listeners onStudyData
method. See module:ct-chart/SeriesListener
.
Parameters:
Name | Type | Description |
---|---|---|
data |
Array | Chart series data in the Caplin Format. |
get Alias() → {String}
Gets the alias name of the study.
The alias name is used to identify the study when deserialising the persisted form.
Returns:
The alias for the Study.
- Type
- String
get Color() → {String|null}
- Deprecated:
- Use
module:ct-chart/Study#getColors
instead. Returns the colour that was set for this study. By default this is null.
- Use
Returns:
The colour of the study.
- Type
- String | null
get Colors() → {Array}
Returns a list of colours for each series this study outputs.
Returns:
List of colours for each study series.
- Type
- Array
get Config Value(key)
Gets a specific Study configuration option.
Parameters:
Name | Type | Description |
---|---|---|
key |
String | The configuration option key. |
Returns:
The configuration option value.
get Derivation Param(key)
Gets a specific Study derivation option.
Parameters:
Name | Type | Description |
---|---|---|
key |
String | The option key. |
Returns:
The derivation option value.
get Derivation Params() → {Object}
Gets the derivation options of the study.
Returns:
The options.
- Type
- Object
get Display Name(series Idxopt) → {String}
Gets the display name of the series, derived from the alias and configuration parameters.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seriesIdx |
Number |
<optional> |
The index of the series. |
Returns:
The internationalised display name.
- Type
- String
get Id() → {String}
Get the ID of this study.
The ID is constructed from the study type and derivation options.
Returns:
The ID of this study.
- Type
- String
get Representation Names() → {Array}
Gets the representation names for individual series generated by the study. This exists for studies that return more than one series (such as the Bollinger band).
Returns:
The list of series names within a study.
- Type
- Array
get Representation Types() → {Array}
Gets the representation types of the data that the study returns (line, spline, ...).
This is used by the module:ct-chart/Chart
to determine how to display the study data.
Returns:
Style of the study data.
- Type
- Array
serialize() → {String}
Returns the serialised state of the study. The serialisation logic is handled by the module:ct-chart/Series
so
you don't have to call this method manually.
Returns:
The XML representation of the object.
- Type
- String