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.Angle Property

Gets or sets the angle by which axis labels are rotated.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v24.2.dll

NuGet Package: DevExpress.Wpf.Charts

#Declaration

public int Angle { get; set; }

#Property Value

Type Description
Int32

An angle, in degrees, by which axis labels are rotated.

#Remarks

An axis label’s Angle property is measured in degrees. The Chart Control rotates labels clockwise.

The following table contains a chart with different Angle property values:

Angle=0 Angle=-30 Angle=30
AxisLabelAngle_0 AxisLabelAngle_-30 AxisLabelAngle_30

The Angle property also specifies rotation for a data template defined in the AxisLabel.ElementTemplate property:

<Window.Resources>
    <DataTemplate x:Key="AxisXLabelTemplate">
        <Border BorderThickness="1" CornerRadius="9" Opacity="1.0">
            <Border.Background>
                <SolidColorBrush Color="LightBlue"/>
            </Border.Background>
            <Label Content="{Binding Path=Content}" 
                   Padding="5,1,5,1.5" 
                   Foreground="DarkSlateBlue" 
                   FontSize="12" />
        </Border>
    </DataTemplate>
</Window.Resources>
...
<dxc:XYDiagram2D.AxisX>
    <dxc:AxisX2D Visible="True">
        <dxc:AxisX2D.Label>
            <dxc:AxisLabel Angle="45" 
                           TextPattern="{}{V} year" 
                           ElementTemplate="{StaticResource AxisXLabelTemplate}"/>
        </dxc:AxisX2D.Label>
    </dxc:AxisX2D>
</dxc:XYDiagram2D.AxisX>

Result:

Axis label angle

See Also