Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

AxisLabel.TextFormat Property

Gets or sets the pattern applied to axis label text. This is a bindable property.

Namespace: DevExpress.Maui.Charts

Assembly: DevExpress.Maui.Charts.dll

NuGet Package: DevExpress.Maui.Charts

#Declaration

C#
public string TextFormat { get; set; }

#Property Value

Type Description
String

The text pattern that axis labels use to display axis values.

#Remarks

Use the TextFormat property to specify a text pattern that axis labels use to convert axis values to strings. Each axis type requires the corresponding format:

Axis Type

Format

NumericAxisX, NumericAxisY

Unicode number pattern characters

DateTimeAxisX

Unicode date pattern characters

The following example shows how to set the text format for labels of a date-time X-axis and numeric Y-axis:

<dxc:ChartView>
    <dxc:ChartView.AxisX>
        <dxc:DateTimeAxisX>
            <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>

Axis Label

The resulting format string may differ depending on the target platform. For more information on text formats, refer to the following help topics:

#Advanced Customization

When axis labels require advanced customization, use an axis’ LabelTextFormatter property. This property allows you to define a custom text for each label. For example, it can be useful when you need labels to display axis values recalculated according to a specific formula or accompany values with conditional prefixes.

Note

The AxisBase.LabelTextFormatter property has a higher priority than the TextFormat property. If both of them are specified, the label displays a formatted value that the LabelTextFormatter provides.

See Also