Back to Devexpress

AxisLabel.Angle Property

wpf-devexpress-dot-xpf-dot-charts-dot-axislabel.md

latest2.5 KB
Original Source

AxisLabel.Angle Property

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

Namespace : DevExpress.Xpf.Charts

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

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public int Angle { get; set; }
vb
Public Property Angle As Integer

Property Value

TypeDescription
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=0Angle=-30Angle=30

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

xaml
<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:

See Also

AxisLabel Class

AxisLabel Members

DevExpress.Xpf.Charts Namespace