- Since:
-
9.4.0
Type Definitions
-
HR
-
Configuration for the current price label. Set to false to disable.
Type:
- boolean | object
- Since:
-
9.4.0
Properties:
Name Type Argument Description upobject <optional>
Colors to use when value is increasing.
Properties
Name Type Argument Description colorobject <optional>
Text color
backgroundColorobject <optional>
Background color
downobject <optional>
Colors to use when value is decreasing.
Properties
Name Type Argument Description colorobject <optional>
Text color
backgroundColorobject <optional>
Background color
-
YAxisConfig
-
All configurations, including themeing, relating to the YAxis object go here. Note: The
YAxisInitobject this inherits from has all optional properties.Type:
- Since:
-
9.4.0
Properties:
Name Type Argument Description drawFnYAxisDrawFunction <optional>
Axis drawing function from Axes import (
Axes.drawYAxis), or custom function.fontSizestring <optional>
Axis font size.
fontFamilystring <optional>
Axis font family.
fontStylestring <optional>
Axis font style (e.g. italic).
fontWeightstring <optional>
Axis font weight (e.g. bold).
backgroundColorstring <optional>
Axis background color.
colorstring <optional>
Axis text color.
gridLineLineTheme <optional>
Axis grid line treatment.
gridDividerLineTheme <optional>
Axis grid divider treatment.
Example
Setting up the default drawFn:
import * as Axes from "../js/modules/axes.js"; const config = { ... yaxis: { drawFn: Axes.drawYAxis, ... } }; -
YAxisDrawFunction(panel [, parameters])
-
Draw function for y axis. Function's
thisis a CompactChart instance.Parameters:
Name Type Argument Description panelPanel Panel of axis.
parametersYAxisInit <optional>
Y Axis parameters.
- Since:
-
9.4.0
-
YAxisFormatter(qc, panel [, price] [, defaultText])
-
Formatting function for y axis labels.
Parameters:
Name Type Argument Description qcCompactChart CompactChart instance.
panelPanel Panel of axis.
pricenumber <optional>
Value to format.
defaultTextstring <optional>
Text that would be displayed without formatter function.
- Since:
-
- 9.4.0 Introduced
- 10.1.0 Added parameter
defaultText.
Returns:
Formatted value as a string.
- Type
- string
-
YAxisInit
-
Properties relating to the y axis that are set by default to certain values. The YAxis object controls anything going on the canvas.
Type:
- object
- Since:
-
9.4.0
Properties:
Name Type Argument Default Description bottomOffsetnumber <optional>
0 Number of pixels to pad bottom of y-axis.
chartAxisMarginMultipliernumber <optional>
2.5 When computing axis scroll and zoom, this value scales the number of pixels for the main chart panel.
decimalPlacesnumber <optional>
Set to fix the number of decimal places for an axis label.
displayGridLinesboolean <optional>
Set to false to not draw horizontal gridlines (panel's main axis only).
drawCurrentPriceLabelboolean <optional>
<nullable>
Set to false to not put a distinct label for the current prices. Set to true to force one even when no y axis is drawn.
drawPriceLabelsboolean <optional>
Set to false to suppress drawing of all labels on the axis.
drawSeriesPriceLabelsboolean <optional>
Set to false to not put a distinct label for series price at rightmost bar.
flippedboolean <optional>
Set to true to flip axis (and all pplots on the axis) upside down (not supported).
?formatterYAxisFormatter <optional>
Optional function to format a price display on the axis.
goldenRatioboolean <optional>
Set to false to turn off the setting of the ratio of vertical gridline spacing to horizontal gridline spacing to 1.618.
groundboolean <optional>
Set to true to limit axis zooming to the the top of axis only.
heightFactornumber <optional>
1 Scale factor for zoom.
hrHR <optional>
Allows styling of the current price label.
idealTickSizePixelsnumber <optional>
Set to force spacing between labels on the axis to a set number of pixels.
incrementsArray.<number> <optional>
[1,2.5,5] Depending on range of axis and spacing of labels, value of labels will increment by these values, from smallest to largest]. Note these increments are multiplied by a factor of 10.
initialMarginBottomnumber <optional>
10 Number of pixels to pad bottom of plots using y-axis.
initialMarginTopnumber <optional>
10 Number of pixels to pad top of plots using y-axis.
justifyRightboolean <optional>
When axis is on right side, set to true to align labels to right. When axis is on left side, set to false to align labels to left.
labelStylestring <optional>
<nullable>
Rendering style of the current price label. Values are: "roundRect", "roundRectArrow", "semiRoundRect", "tickedRect", "rect", "noop", null.
lockScaleboolean <optional>
Set to true to disable auto-zooming when scrolling.
maxnumber <optional>
<nullable>
When set, determines maximum price of the axis.
maxDecimalPlacesnumber <optional>
<nullable>
Set to fix the maximum number of decimal places for an axis label.
minnumber <optional>
<nullable>
When set, determines minimum price of the axis.
namestring <optional>
Unique name of axis.
noDrawboolean <optional>
Set to true to hide the axis (but its footprint is preserved).
positionstring <optional>
<nullable>
'right' Where the axis appears ("left", "right", "none").
rangeArray.<number> <optional>
Used to specify a functional range for the axis.
Elements
Index Type Argument Description 0number <optional>
Minimum value.
1number <optional>
Maximum value.
scrollnumber <optional>
0 Number of pixels to shift the axis from its centered position.
shadowBreaksArray.<Array.<number>> <optional>
Array of number pairs. Array is iterated to determine number of decimal places to display. Given a value, if it is below the first element of an array entry, display the number of decimal places in the second entry. Default is [ [1000, 2], [5, 4], [0.001, 8] ].
textBackgroundstring <optional>
<nullable>
Optional CSS color of text background.
textStylestring <optional>
<nullable>
Optional CSS color of text.
topOffsetnumber <optional>
0 Number of pixels to pad top of y-axi.
widthnumber <optional>
1 Initial pixel width of axis. Width changes dynamically with respect to label widths.
zoomnumber <optional>
0 Number of pixels to spread the axis range.
