YAxisComponent

September 4, 2023 ยท View on GitHub

Y axis component. Contains all Y axis related logic.

MethodParametersReturnsDescription
registerDefaultLabelColorResolversvoidRegisters default label color resolvers for different chart types.
doActivatevoidThis method is used to activate a protected feature. It does not take any arguments and does not return anything.
updateCursorvoid
updateOrderedLabelsadjustYAxisWidth: booleanvoidUpdates labels visual appearance on canvas
registerLabelColorResolverchartType: keyof BarTypes - The type of chart for which the label color resolver is being registered.resolver: LabelColorResolver - The function that will be used to resolve the color of the labels for the specified chart type.voidRegisters a label color resolver for a specific chart type.
getLabelsColorResolvercandlesType: string - The type of data series.LabelColorResolverReturns a function that resolves the color for a label based on the type of data series.
registerYAxisLabelsProviderprovider: YAxisLabelsProvider groupName: string - a group in which labels position recalculation algorithm will be applied, usually it's subchart nameid: stringstringYou can add a custom labels provider for additional labels on YAxis (like for drawings, symbol last price, studies, etc..)
addSimpleYAxisLabelname: string label: VisualYAxisLabelvoidAn easier way to manage custom y-axis labels, than y-axis labels providers. However, overlapping avoidance is not supported
deleteSimpleYAxisLabelname: stringvoid
getAxisTypePriceAxisType
unregisterYAxisLabelsProvidergroupName: string - The name of the group from which to unregister the provider. Defaults to LabelsGroups.MAIN.id: string - The ID of the provider to unregister.stringUnregister a Y axis labels provider from the specified group.
getBoundsBounds
registerYAxisWidthContributorcontributor: YAxisWidthContributorvoidIf custom pane has y-axis it has to register width contributor to correctly calculate overall y-axis width.
setAxisTypetype: PriceAxisType - the type of axisvoidSets the type of axis: percent, regular or logarithmic.
setYAxisAlignalign: YAxisAlignvoidChange YAxis position to left or to right
setVisibleisVisible: booleanvoidControls visibility of the y-axis
isVisiblebooleanIf visible, when you can see the y-axis on the chart
setLockPriceToBarRatiovalue: booleanvoidControls lockPriceToBarRatio of the y-axis
changeLabelModetype: string - label typemode: YAxisLabelMode - visual modevoidChanges the visual type of particular label.
changeLabelAppearancetype: string - label typemode: YAxisLabelAppearanceType - visual modevoidChanges the visual type of particular label.
togglePriceScaleInverseinverse: boolean - true or falsevoidSets the inverse price scale mode. Inverts Y axis vertically. Inversion also works for candles, drawings and overlay studies.
changeLabelsDescriptionVisibilitydescVisibility: boolean - A boolean value indicating whether the descriptions should be visible or not.voidChanges the visibility of the labels' descriptions.