XAxisComponent

August 10, 2023 ยท View on GitHub

X-axis component, contains all x-axis calculation and rendering logic.

MethodParametersReturnsDescription
doActivatevoidThis method is used to activate the chart and update the labels if there is a new data set or equivolume type. It subscribes to the chart type change, candles set subject, candles updated subject, and time zone change to generate new labels.
It also subscribes to the x-axis scale change and canvas resize to recalculate the labels.
getDrawerXAxisTimeLabelsDrawerReturns the xAxisDrawer object.
registerXAxisLabelsProviderprovider: XAxisLabelsProvidervoidYou can add a custom labels provider for additional labels on XAxis (like for drawings)
setVisibleisVisible: booleanvoidControls visibility of the x-axis
setFormatsForLabelsConfignewFormatsByWeightMap: Record<TimeFormatWithDuration, string>voidSet new config for x labels formatting
isVisiblebooleanIf visible, when you can see the x-axis on the chart