new PlotComplementer(params)
Creates an add-on that enables a series to complement another series.
The complementary series is a permanent fixture of the series which it complements. It moves in tandem with the series, and gets removed with the series. In all other respects, though, it behaves like its own series. It shows separately in the panel legend and plots using its own renderer.
Charts can have multiple PlotComplementer
instances. Each instance is attached to the chart
engine as a member of a PlotComplementer
collection.
Multiple PlotComplementer
instances can be associated with a time series. To link a
PlotComplementer
to a series, specify the series instrument in the params.filter
function.
See setQuoteFeed
.
Note: The series created by this add-on is not exported with the layout, since it is created in tandem with the series it complements. Currently, this feature works only with non-comparison series.
Requires addOns.js.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | Configuration parameters. Properties
|
- Since:
-
7.3.0
Example
let forecaster = new CIQ.PlotComplementer({
stx:stxx,
id:"forecast",
quoteFeed: fcstFeed.quoteFeedForecastSimulator,
behavior: {refreshInterval:60},
decorator: {symbol:"_fcst", display:" Forecast"},
renderingParameters: {chartType:"channel", opacity:0.5, pattern:"dotted"}
});
Methods
-
resetRenderingParameters()
-
Resets the
PlotComplementer
rendering values to the default settings.Default settings can be provided in the parameters passed to the
PlotComplementer
constructor. If no settings are provided to the constructor,PlotComplementer
uses the following defaults:{ chartType:"line", width:1, opacity:0.5 }
.The rendering parameters may be set anytime after creating
PlotComplementer
; for example, to set an ad-hoc rendering right before adding a series.- Since:
-
7.3.0
-
setQuoteFeed(params)
-
Sets a quote feed for the
PlotComplementer
.Automatically called when a quote feed is provided in the constructor argument. If a quote feed or
behavior
object is not specified inparams
, this function returns without doing anything.Parameters:
Name Type Description params
object Configuration parameters.
Properties
Name Type Argument Description quoteFeed
object Quote feed to attach to the quote driver to satisfy any quote requests for any series created by the add-on. This quote feed is like any time series quote feed object. See the Data Integration Overview.
behavior
object Behavior for the quote feed supplied in this parameter list. This object is like any
behavior
object associated with a quote feed. See CIQ.ChartEngine#attachQuoteFeed for more information onbehavior
objects.filter
function <optional>
Filters the quote feed supplied in this parameter list. The filter function takes as an argument an object typically containing
symbolObject
,symbol
, andinterval
properties. The properties associate thePlotComplementer
with an instrument. If thefilter
function returns true, thePlotComplementer
quote feed is used for the instrument.This
filter
function is like thefilter
in basic quote feeds. See CIQ.ChartEngine#attachQuoteFeed for more information on quote feedfilter
functions.- Since:
-
7.3.0