Optional
Readonly
eventsOptional
optionProtected
optionsStatic
optionsthe first buffer handle of the underlying data
an optional manually assigned custom name to overwrite the automatically assigned name provided by the loader
error message to be shown to the user
the full identifier of the timeseries
check if this timeseries is the main time series in its context
to promote a timeseries, use Controller.selectMainTimeSeries
the name of this timeseries legend entry
the format of the display name to be shown in the legend supports variables like {name} multiple variables can be joined with {SEPARATOR|VARIABLE|VARIABLE|...}
also supports conditionals that are only displayed when at least one enclosed variable has a value: "[Currency: {currency}]"
available variables depend on used data loader that has to provide them in the properties object as part of the metadata
Example: "{name}[ ({, |currency|qs})]" => "DAX (XXP, Last)" or "Foo (Bid)" or "Foo ($)" or "Foo"
the timeseries' layer type. Valid values:
maximum decimal precision of the provided values
the entries reference timestamp for relative benchmark charts this value is always zero in absolute charts
the entries reference value for relative benchmark charts this value is always zero in absolute charts
transforms timeseries data to relative performance
the type of transformation applied to the entries raw values possible values include but are not limited to: candle, pf, kagi, renko, ha
additional information about transformation parameters applied to the entries raw values this could e.g. include box size and reversal for point and figure charts
the data source type of this timeseries
the timeseries' most recent primary value
returns or sets the attribute of an option this function should be used with care - modifications of internal properties might break stuff!
Optional
v: anymust be called after willUpdateOptions
once all actions that might potentially changed values of any options are done
IMPORTANT: methods must be called in balance; e.g. for each call to willUpdateOptions
, you must call didUpdateOptions
exactly once.
returns a flat representation of all available config options in the form of a key-value-object optionally only values that are not read-only can be returned
IMPORTANT: this method will always convert I18NStrings to strings, so for displaying strings in a UI use individual calls to Object:get instead
Optional
readWriteOnly: booleandefault: true
Optional
modifiedOnly: booleandefault: true
Optional
nonEphemeralOnly: booleandefault: true
returns the value of the requested option, or a list of all available config options if no parameter is specified.
Optional
s: stringOptional
flags: numberreturns the specified buffer valid values are: close,open,high,low,volume
returns the categorization of the objects options can be used for displaying a more structured user interface
returns the timeseries' metadata
returns a key-value object containing arbitrary properties provided by the underlying data source
returns a specific property provided by the underlying data source
returns the objects current state
Automatically toggles the EXPOSED flag on dependent options when a 'parent' option changes value.
For each entry in optionDependencies
, whenever the parent option
emits an optionChanged
event, its dependents (listed in dependentNames
)
will be exposed (flag added) if the new value === exposeWhen
, or
hidden (flag removed) otherwise.
Map where:
exposeWhen
: the boolean that triggers exposing the dependents or a function with the newValue for custom validationdependentNames
: array of dependent option names whose EXPOSED flag will be toggledclass Test extends ChartbreakerObject {
constructor() {
super();
this.registerOptionDependencyVisibility(new Map([
['showLine', { exposeWhen: true, dependentNames: ['lineColor', 'lineStyle'] }],
['advancedMode', { exposeWhen: false, dependentNames: ['simpleModeOnlyOption'] }],
['description'], { exposeWhen: (text) => !!text.length, ['fontSize', 'fontColor']}
]));
}
}
life cycle method; called when the object should start normal operation at this point is is already completely initialized
life cycle method; called when the object should stop normal operation if objects have any pending subscriptions/requests, they should all be stopped here
the object is also responsible for clearing the loading flag from it's state if it is currently active failing to do so will trigger a fatal error
object might be started again afterwards (start) or destroyed (destroy) this is not known yet at this point
called after start or restart
can be called to tell the object that it should recover from an error and resume will have no effect if no retryable error is currently associated with the object
Optional
type: Typewill set validate and then set the specified option(s) to the provided value(s) after validation
NOTE: if multiple options are used, will return false if at least one value is not valid values are applied individually however, so one option might be set even if the value for another is invalid
Optional
v: anyOptional
flags: ObjectEFlagsby default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that limit to be increased. Set to zero for unlimited.
Sets the objName and objType of the Object reverts to the default ones if no arguments are given
Optional
objType: stringOptional
objName: stringReturns a string representation of an object.
will set validate value(s) for the specified option(s)
NOTE: if multiple options are used, will return false if at least one value is not valid
Optional
v: anyOptional
flags: ObjectEFlagswhen using custom getters/setters (via _get/_set) in options, the values of options can change
without .set being called - or there might not even be a setter for readonly options;
for example, if the getter simply returns the value of a member variable
this variable could be modified directly.
In this case, events such as optionChanged
would not be fired, and listeners would not be informed about the change.
To account for such cases, the methods willUpdateOptions
and didUpdateOptions
should be called directly BEFORE and AFTER
actions that might potentially change values of options.
the correct events will then automatically be triggered when calling didUpdateOptions
.
if the options that could change are known, they can be supplied via the optional parameter. This provides a small performance gain in most situations.
IMPORTANT: methods must be called in balance; e.g. for each call to willUpdateOptions
, you must call didUpdateOptions
exactly once.
Optional
options: string | string[]Static
guardStatic
listenerStatic
plotStatic
set
A TimeSeries object represents a set of data values such as OHLC-quotes with volume information or some other arbitrary data.