Namespace for functionality related to comparison series.
Members
-
initialPrice :number|string
-
For relative comparisons, this is the starting (baseline) point.
Valid options are:
- A number to specify an absolute amount to be used as the starting value for all percentage changes.
- A string containing the symbol of an existing series to be used as the starting value for the comparisons (for instance "IBM"). Computations will then be based on the change from the first visible bar value for the selected symbol.
- An empty string will compare against the baseline value of the main series (same as in "percent" scale).
See CIQ.ChartEngine#setChartScale for more details.
Type:
- number | string
- Since:
-
5.1.0
Methods
-
percentToPrice(stx, chart, percent [, yAxis] [, field])
-
Untransform function for percent comparison charting
Parameters:
Name Type Argument Description stx
CIQ.ChartEngine The charting object
chart
CIQ.ChartEngine.Chart The specific chart
percent
number The price to untransform
yAxis
CIQ.ChartEngine.YAxis <optional>
Axis where price is to be found
field
string <optional>
Field whose price needs converting, otherwise the main series is converted
- Since:
-
8.4.0 Added
yAxis
andfield
parameters. Can now untransform a series price, provided the series name is set in thefield
parameter.
Returns:
The untransformed price
- Type
- number
-
priceFormat(stx, panel, price)
-
Formats the percentage values on the comparison chart
Parameters:
Name Type Description stx
CIQ.ChartEngine The chart object
panel
CIQ.ChartEngine.Panel The panel
price
number The raw percentage as a decimal
Returns:
The percentage formatted as a percent (possibly using localization if set in stx)
- Type
- string
-
priceToPercent(stx, chart, price [, yAxis] [, field])
-
Transform function for percent comparison charting
Parameters:
Name Type Argument Description stx
CIQ.ChartEngine The charting object
chart
CIQ.ChartEngine.Chart The specific chart
price
number The price to transform
yAxis
CIQ.ChartEngine.YAxis <optional>
Axis where price is to be found
field
string <optional>
Field whose price needs converting, otherwise the main series is converted
- Since:
-
8.4.0 Added
yAxis
andfield
parameters. Can now transform a series price, provided the series name is set in thefield
parameter.
Returns:
The transformed price (into percentage)
- Type
- number
-
priceToRelative(stx, chart, price [, yAxis] [, field])
-
Transform function for relative comparison charting
Parameters:
Name Type Argument Description stx
CIQ.ChartEngine The charting object
chart
CIQ.ChartEngine.Chart The specific chart
price
number The price to transform
yAxis
CIQ.ChartEngine.YAxis <optional>
Axis where price is to be found
field
string <optional>
Field whose price needs converting, otherwise the main series is converted
- Since:
-
- 5.1.0
- 8.4.0 Added
yAxis
andfield
parameters. Can now transform a series price, provided the series name is set in thefield
parameter.
Returns:
The transformed price (relative to CIQ.Comparison.initialPrice)
- Type
- number
-
relativeToPrice(stx, chart, relative [, yAxis] [, field])
-
Untransform function for relative comparison charting
Parameters:
Name Type Argument Description stx
CIQ.ChartEngine The charting object
chart
CIQ.ChartEngine.Chart The specific chart
relative
number The price to untransform
yAxis
CIQ.ChartEngine.YAxis <optional>
Axis where price is to be found
field
string <optional>
Field whose price needs converting, otherwise the main series is converted
- Since:
-
- 5.1.0
- 8.4.0 Added
yAxis
andfield
parameters. Can now transform a series price, provided the series name is set in thefield
parameter.
Returns:
The untransformed price
- Type
- number