AxisLabel.Angle Property

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

Namespace: DevExpress.Xpf.Charts

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

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