Class: Outliers

CIQ. Outliers


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.

Requires js/addOns.js.

Chart with hidden outliers

Parameters:
Name Type Description
params Object

Configuration parameters.

Properties
Name Type Argument Default Description
stx CIQ.ChartEngine <optional>

A reference to the chart object.

multiplier Number <optional>
3

Sets the threshold for outliers by multiplying the normal data range. The default value hides only extreme outliers.

Since:
  • 7.5.0

Example
new CIQ.Outliers({ stx: stxx });

Methods


deprecateMarkers()

Removes all markers that have a freshness property of false. Sets the freshness property of all remaining outlier markers to false; these markers will be removed on the next call to this method if, in the meantime, a search of the data set does not find the associated outlier and reset the freshness property of the marker to true.

Since:
  • 7.5.0


find(dataSet)

Finds the outliers of a data set, which is an array of quotes and associated values.

Parameters:
Name Type Description
dataSet Array

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


markAxis()

Places markers on the y-axis when high or low outliers exist.

Since:
  • 7.5.0


markOutlier(data, position)

Adds an outlier marker to a tick. Accepts a quote object which is marked as an outlier.

Parameters:
Name Type Description
data Object

An object containing the outlier value and its associated quote; for example, {value: Number, quote: Object}.

position String

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.

Since:
  • 7.5.0

Returns:

The outlier marker 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
node HTMLElement

The y-axis marker to style.

Since:
  • 7.5.0


refreshAxisMarkers(node)

Updates the position of the y-axis outlier marker passed as an argument.

Parameters:
Name Type Description
node HTMLElement

The y-axis marker to position.

Since:
  • 7.5.0


removeAllMarkers()

Removes all outlier markers.

Since:
  • 7.5.0


setDisplayState(newState)

Sets the outlier display state, which determines whether to display outlier markers.

Parameters:
Name Type Description
newState String

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.

If none of the above is provided, "none" is assumed.

Since:
  • 7.5.0


updateMarkerVisibility()

Shows or hides outlier markers based on the display state.

See setDisplayState.

Since:
  • 7.5.0