Skip to main content

CustomAxisLabel Class

Represents an individual custom label of an axis.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v23.1.dll

NuGet Package: DevExpress.Wpf.Charts


public class CustomAxisLabel :

The following members return CustomAxisLabel objects:


The CustomAxisLabel class contains the settings that define the functionality of a custom axis labels.

In addition to the settings inherited from the base ChartElement class, the CustomAxisLabel class implements properties that allow you to specify the corresponding axis value in which the label is displayed at (CustomAxisLabel.Value) and its content (CustomAxisLabel.Content).

Custom label objects associated with a particular axis are contained within its CustomAxisLabelCollection returned by the Axis2D.CustomLabels property.

Custom labels defined for an axis can’t be displayed together with its default labels. If an axis has any custom label, the default labels are not displayed within the axis.

For more information, refer to Axis Labels.


This example demonstrates how custom axis labels are created and customized in the Chart control.

To add a custom axis label on the chart, create a CustomAxisLabel object and add it to the CustomAxisLabelCollection returned by the Axis2D.CustomLabels property.

To show the custom label on the X-axis or Y-axis, specify an axis value that corresponds to the label position on an axis (using the CustomAxisLabel.Value property) and to its content (via the CustomAxisLabel.Content property).

You can customize custom label appearance using the Foreground, FontFamily, FontWeight, and FontStyle properties for the AxisLabel object.

For more information about custom axis labels, see the Axis Labels topic.

View Example

        Title="Custom Axis Label" Height="350" Width="525">
                <dxc:Title Content="Population Level by Country" HorizontalAlignment="Center"/>
                            <dxc:AxisLabel FontSize="14" Foreground="#FF0E5ED6" FontWeight="Bold"/>
                            <dxc:CustomAxisLabel  Value="1" Content="Brazil"/>
                            <dxc:CustomAxisLabel  Value="2" Content="Indonesia"/>
                            <dxc:CustomAxisLabel  Value="3" Content="USA"/>
                            <dxc:CustomAxisLabel  Value="4" Content="India"/>
                            <dxc:CustomAxisLabel  Value="5" Content="China"/>
                            <dxc:AxisLabel FontFamily="Verdana" FontStyle="Italic" Foreground="#FF9E5D2F"/>
                            <dxc:CustomAxisLabel Content="Low" Value="3"/>
                            <dxc:CustomAxisLabel Content="Middle" Value="6"/>
                            <dxc:CustomAxisLabel Content="High" Value="16"/>
                    <dxc:SeriesPoint Argument="1" Value="2"/>
                    <dxc:SeriesPoint Argument="2" Value="3"/>
                    <dxc:SeriesPoint Argument="3" Value="5"/>
                    <dxc:SeriesPoint Argument="4" Value="17"/>
                    <dxc:SeriesPoint Argument="5" Value="20"/>
See Also