maui-devexpress-dot-maui-dot-charts-dot-axisbase-a312b8ad.md
Provides access to the settings that specify the text format, position, and appearance of axis labels. This is a bindable property.
Namespace : DevExpress.Maui.Charts
Assembly : DevExpress.Maui.Charts.dll
NuGet Package : DevExpress.Maui.Charts
public AxisLabel Label { get; set; }
| Type | Description |
|---|---|
| AxisLabel |
An object that stores axis label settings.
|
Axis labels display values at major tickmarks. They are automatically generated based on series’ data.
To configure axis labels, assign the AxisLabel object with the specified properties to the axis’s Label property.
The AxisLabel.TextFormat property specifies a pattern used to format text that axis labels display. Use this property if conditional formatting is not required and all labels should have the same text format.
<dxc:ChartView>
<dxc:ChartView.AxisX>
<dxc:DateTimeAxisX MeasureUnit="Year">
<dxc:DateTimeAxisX.Label>
<dxc:AxisLabel TextFormat="yyyy"/>
</dxc:DateTimeAxisX.Label>
</dxc:DateTimeAxisX>
</dxc:ChartView.AxisX>
<dxc:ChartView.AxisY>
<dxc:NumericAxisY>
<dxc:NumericAxisY.Label>
<dxc:AxisLabel TextFormat="$#K"/>
</dxc:NumericAxisY.Label>
</dxc:NumericAxisY>
</dxc:ChartView.AxisY>
</dxc:ChartView>
Note
When axis labels require advanced customization (for example, conditional prefix), use an axis’s LabelTextFormatter property. It allows you to set a custom text for each label. Note that this property has a higher priority than AxisLabel.TextFormat. If both of them are specified, the label displays a formatted value that the LabelTextFormatter provides.
Axis labels can be displayed inside or outside the plot area. Use the AxisLabel.Position property to change the labels’ position.
<dxc:ChartView.AxisY>
<dxc:NumericAxisY>
<dxc:NumericAxisY.Label>
<dxc:AxisLabel Position="Inside"/>
</dxc:NumericAxisY.Label>
</dxc:NumericAxisY>
</dxc:ChartView.AxisY>
To change the appearance of axis labels, use the AxisLabelBase.Style property. It provides access to the AxisLabelStyle object. This object’s TextStyle property allows you to access and specify axis labels’ text appearance settings (font color and size).
<dxc:ChartView.AxisY>
<dxc:NumericAxisY>
<dxc:NumericAxisY.Label>
<dxc:AxisLabel>
<dxc:AxisLabel.Style>
<dxc:AxisLabelStyle>
<dxc:AxisLabelStyle.TextStyle>
<dxc:TextStyle Color="DarkGray" Size="16"/>
</dxc:AxisLabelStyle.TextStyle>
</dxc:AxisLabelStyle>
</dxc:AxisLabel.Style>
</dxc:AxisLabel>
</dxc:NumericAxisY.Label>
</dxc:NumericAxisY>
</dxc:ChartView.AxisY>
Use the AxisLabelBase.Visible to control the visibility of axis labels.
<dxc:ChartView.AxisY>
<dxc:NumericAxisY>
<dxc:NumericAxisY.Label>
<dxc:AxisLabel Visible="False"/>
</dxc:NumericAxisY.Label>
</dxc:NumericAxisY>
</dxc:ChartView.AxisY>
See Also