- Since:
-
9.4.0
Type Definitions
-
XAxisConfig
-
All configurations, including themeing, relating to the XAxis object go here. Note: The
XAxisInitobject this inherits from has all optional properties.Type:
- Since:
-
9.4.0
Properties:
Name Type Argument Description drawFnXAxisDrawFunction <optional>
Axis drawing function from Axes import (
Axes.drawXAxis), or custom function.intervalFormattingRecord.<string, XAxisIntervalFormatter> <optional>
Axis formatting object from Axes import (
Axes.setPropertiesForInterval), or custom object.representationFnXAxisRepresentationFunction <optional>
<nullable>
Axis representation function from Axes import (
Axes.axisRepresentation), 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.
gridBoundaryLineTheme <optional>
Axis grid boundary line treatment.
Example
Setting up the x axis default functions:
import * as Axes from "../js/modules/axes.js"; const config = { ... xaxis: { drawFn: Axes.drawXAxis, intervalFormatting: Axes.setPropertiesForInterval, representationFn: Axes.xaxisRepresentation, ... } }; -
XAxisDataRecord
-
Record containing data to be displayed on an axis tick.
Type:
- object
- Since:
-
9.4.0
Properties:
Name Type Argument Description dtDate <optional>
Date of record.
dataDataRecord <optional>
<nullable>
Data, if available.
-
XAxisDrawFunction( [axisRepresentation])
-
Draw function for x axis. Function's
thisis a CompactChart instance. This function should utilize an algorithm to determine which of the ticks passed in as input should actually be rendered. There are often many more possible ticks than can be drawn legibly on the chart.Parameters:
Name Type Argument Description axisRepresentationArray.<XAxisRepresentationRecord> <optional>
Array of possible ticks.
- Since:
-
9.4.0
-
XAxisFormatter(dt)
-
Formatting function for x axis labels.
Parameters:
Name Type Description dtDate Date to format.
- Since:
-
9.4.0
Returns:
Formatted date as a string.
- Type
- string
-
XAxisInit
-
Properties relating to the x axis that are set by default to certain values. The XAxis object controls anything going on the canvas.
Type:
- object
- Since:
-
- 9.4.0 Introduced
- 10.1.0 Set
noDrawtype to boolean.
Properties:
Name Type Argument Default Description adjustTimeZoneboolean <optional>
Set to false to disallow timezone support on the axis.
asFooterboolean <optional>
Set to false to draw axis under the main chart panel as opposed to under the bottom-most panel.
displayGridLinesboolean <optional>
Set to false to not draw vertical gridlines.
formatterXAxisFormatter <optional>
<nullable>
Optional function to format a date display on the axis.
futureTicksboolean <optional>
Set to false to stop displaying axis labels in the future.
futureTicksIntervalnumber <optional>
1 When displaying tick periodicity, this value is the "period", or number of ticks to consolidate.
heightnumber <optional>
Pixel height of axis.
lineBaseLevelnumber <optional>
500 Minimum state level of a non-boundary label on the axis.
minimumLabelWidthnumber <optional>
50 Smallest number of pixels an axis label can take up.
noDrawboolean <optional>
Set to true to hide the axis (but its footprint is preserved).
-
XAxisIntervalFormatter(repRecord, record, market, qc)
-
Formatting function for x axis labels based on the interval being displayed. Function does not actually return anything; it populates a
textfield in the XAxisRepresentationRecord with the formatted string.Parameters:
Name Type Description repRecordXAxisRepresentationRecord Object with properties used for rendering tick on axis.
recordXAxisDataRecord Data for the tick being formatted.
marketMarket | undefined Market of main symbol on chart.
qcCompactChart CompactChart instance.
- Since:
-
9.4.0
-
XAxisRepresentationFunction()
-
Function that returns x axis representation. This is an array of objects representing possible ticks on the x axis. Function's
thisis a Chart instance.- Since:
-
9.4.0
Returns:
Array of possible ticks.
- Type
- Array.<XAxisRepresentationRecord>
-
XAxisRepresentationRecord
-
Abstract class for a user-defined object containing fields to be used to help draw an axis tick. The fields in this object are not important to the CompactChart core but the contract is meant to be understood by the
drawFn,representationFn, andintervalFormattingfunctions specified in the configuration.Type:
- object
- Since:
-
9.4.0
Properties:
Name Type Argument Description textstring <optional>
Text to display
