new Outliers(params)
Creates the outliers add-on which scales the y-axis to the main trend, hiding outlier values. Markers are placed at the location of the outlier values enabling the user to restore the full extent of the y-axis by selecting the markers.
Outliers show/hide can be toggled using the Ctrl+Alt+O keystroke combination (see the
outliers action in hotkeyConfig.hotkeys in js/defaultConfiguration.js).
Requires addOns.js.

Parameters:
| Name | Type | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | Configuration parameters. Properties
|
- Since:
-
- 7.5.0
- 8.0.0 Added
params.altColorsandparams.menuContextClass.
Example
new CIQ.Outliers({ stx: stxx });
Methods
-
deprecateMarkers(targetAxis)
-
Removes all markers from
targetAxisthat are no longer fresh; that is, markers that do not represent data points in the current data set, or axis markers that are irrelevant because high or low outliers no longer exist. Sets the status of all remaining outlier markers to stale, or not fresh (the freshness status should subsequently be reevaluated).Parameters:
Name Type Description targetAxisobject The y-axis for which the markers are deprecated. Note: A chart or panel can have multiple y-axes; each y-axis has its own outlier markers based on the data rendered on the axis.
- Since:
-
- 7.5.0
- 8.0.0 Added
targetAxisparameter.
-
find(dataSet)
-
Finds the outliers contained in
dataSet.Note: This function may be overridden to provide a custom algorithm for finding outliers.
Parameters:
Name Type Description dataSetarray An array of objects of the form
{value: Number, quote: Object}. Each object contains a value and its associated quote. The value is checked to determine whether it is an outlier of the data set. When checking more than one value for a quote (such as an OHLC quote), each value is included in a separate object; for example,[{value: open, quote: quote}, {value: high, quote: quote}, {value: low, quote: quote}, {value: close, quote: quote}...].- Since:
-
- 7.5.0
- 8.0.0 Added return value.
Returns:
An object of the form:
{ // Minimum and maximum threshold values of dataSet to be considered an outlier. minValue: null, maxValue: null, // Mininum and maximum values of dataSet that are not considered outliers. // Will be the least and greatest values in dataSet if no outliers are found. trendMin: null, trendMax: null, // Minimum and maximum values of dataSet that are considered outliers. // Will remain null if no outliers are found. outlierMin: null, outlierMax: null, // Array of individual outlier information for marker placement, in the format {DT:DateTime, value:Number, position:String} // (position is either 'high' or 'low'). activeOutliers: [] }- Type
- object
-
flipMarkers(targetAxis)
-
Repositions outlier markers from the top of the display to the bottom (or vice versa) when the associated y-axis has been flipped (inverted).
Parameters:
Name Type Description targetAxisobject The y-axis that has been flipped.
- Since:
-
8.0.0
-
handleMarkerClick(position, targetAxis, targetNode)
-
Calls setDisplayState in response to selecting an outlier marker.
Parameters:
Name Type Description positionstring The position of the marker; either "high" or "low".
targetAxisobject The y-axis that contains the selected marker. Note: Charts and panels can have multiple y-axes; each y-axis has its own outlier markers.
targetNodeHTMLElement The selected outlier marker DOM node.
- Since:
-
8.0.0
-
markAxis(position, targetAxis)
-
Places markers on the y-axis when high or low outliers exist.
Parameters:
Name Type Description positionstring The position of the marker; either "high" or "low". If the position is "high", the marker is placed at the top of the axis; if "low", at the bottom of the axis.
targetAxisobject The y-axis on which the markers are placed. Note: Charts and panels can have multiple y-axes, each with its own outlier markers.
- Since:
-
- 7.5.0
- 8.0.0 Added
positionandtargetAxisparameters and return value.
Returns:
The axis outlier marker, which is added to the display.
- Type
- CIQ.Marker
-
markOutlier(data, position, targetAxis)
-
Adds an outlier marker to a tick (data point).
Parameters:
Name Type Description dataobject Represents the tick that is marked as an outlier. Contains the outlier value and its associated quote; for example,
{value: Number, quote: Object}.positionstring The position of the marker; either "high" or "low". If the position is "high", the marker is placed at the top of the chart; if "low", at the bottom of the chart.
targetAxisobject The y-axis to which the marker is added. Note: A chart or panel can have multiple y-axes; each y-axis has its own outlier markers.
- Since:
-
- 7.5.0
- 8.0.0 Added
targetAxisparameter.
Returns:
The outlier marker, which is added to the display.
- Type
- CIQ.Marker
-
matchYAxisStyle(node)
-
Sets the CSS style properties of the y-axis outlier marker to match the CSS styling of the y-axis itself.
Parameters:
Name Type Description nodeHTMLElement The y-axis marker to style.
- Since:
-
7.5.0
-
processDataSet(dataSet, panel, axis)
-
Checks for outlier values in
dataSet, and adds outlier markers (data point markers and axis markers) toaxis.Parameters:
Name Type Description dataSetarray An array of objects of the form
{value: Number, quote: Object}. Each object contains a value and its associated quote. The value is checked to determine whether it is an outlier of the data set. When checking more than one value for a quote (such as an OHLC quote), each value is included in a separate object; for example,[{value: open, quote: quote}, {value: high, quote: quote}, {value: low, quote: quote}, {value: close, quote: quote}...].panelobject The panel where
dataSetis rendered.axisobject The y-axis against which
dataSetis rendered. Note: Charts and panels can have multiple y-axes; each y-axis has its own set of outlier markers based on the data rendered on the axis.- Since:
-
8.0.0
Returns:
A tuple consisting of the outlier minimum and maximum — or trend minimum and maximum, if no outliers are found — to be handled by the CIQ.ChartEngine#determineMinMax method. See the return value of the find function for a description of outlier and trend minimum and maximum.
- Type
- array
-
refreshAxisMarkers(node, targetAxis)
-
Updates the position of the axis outlier marker represented by
node.Parameters:
Name Type Description nodeHTMLElement The axis marker to position.
targetAxisobject The y-axis on which the axis marker is positioned.
- Since:
-
- 7.5.0
- 8.0.0 Added
targetAxisparameter.
-
refreshMarkerArray(targetAxis)
-
Updates the freshness status of outlier markers belonging to
targetAxis.Sets the status to fresh if the markers represent data points in the
activeOutlierslist oftargetAxisor a marker is an axis marker for high or low outliers and high or low outliers exist. (See the return value of the find function for a description of theactiveOutlierslist.)Adds new markers to
targetAxisfor data points in theactiveOutlierslist not already represented by a marker (see markOutlier). Adds new axis markers if the data set rendered ontargetAxiscontains high or low outliers and the respective axis marker does not exist (see markAxis).Sets the status of all other markers belonging to
targetAxisto stale, or unfresh (these markers are ultimately removed).Parameters:
Name Type Description targetAxisobject The y-axis for which the markers are refreshed. Note: Charts and panels can have multiple y-axes, each with its own array of outlier markers.
- Since:
-
8.0.0
-
refreshMarkers(targetAxis)
-
Updates the display styles of all outlier markers belonging to
targetAxis, including data point markers and axis markers. Shows the markers if outliers are hidden and the marked outliers exceed the bounds oftargetAxis. Flips the markers iftargetAxishas been inverted (see flipMarkers).Parameters:
Name Type Description targetAxisobject The y-axis on which the markers are refreshed. Note: Charts and panels can have multiple y-axes, each with its own outlier markers.
- Since:
-
8.0.0
-
removeAllMarkers(targetAxis)
-
Removes all outlier markers from
targetAxis, including data point markers and y-axis markers.Parameters:
Name Type Description targetAxisobject The y-axis from which the markers are removed. Note: Charts and panels can have multiple y-axes, each with its own outlier markers.
- Since:
-
- 7.5.0
- 8.0.0 Added
targetAxisparameter.
-
setDisplayState(newState, targetAxis)
-
Sets the outlier display state, which determines whether to display outlier markers.
Parameters:
Name Type Description newStatestring The intended display state; should be one of:
- "high" — Show high outliers; hide high outlier markers.
- "low" — Show low outliers; hide low outlier markers.
- "all" — Show high and low outliers; hide high and low outlier markers.
- "none" — Hide high and low outliers; show high and low outlier markers.
targetAxisobject The y-axis on which the outlier state is set. Note: A chart or panel can have multiple y-axes.
- Since:
-
- 7.5.0
- 8.0.0 Added
targetAxisparameter.
-
setMarkerColor(node, color)
-
Applies a background color to an outlier data point marker.
Parameters:
Name Type Description nodeHTMLElement The outlier marker DOM node to which the background color is applied.
colorstring The hexadecimal color value set as the node background color.
- Since:
-
8.0.0
-
updateMarkerVisibility()
-
Shows or hides outlier markers based on the display state.
See setDisplayState.
- Since:
-
7.5.0
