Back to Devexpress

Axis2D.LabelAlignment Property

wpf-devexpress-dot-xpf-dot-charts-dot-axis2d-b5932a1b.md

latest5.6 KB
Original Source

Axis2D.LabelAlignment Property

Gets or sets the axis label alignment. This is a dependency property.

Namespace : DevExpress.Xpf.Charts

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

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public AxisLabelAlignment LabelAlignment { get; set; }
vb
Public Property LabelAlignment As AxisLabelAlignment

Property Value

TypeDescription
AxisLabelAlignment

The value that defines the axis label alignment.

|

Available values:

NameDescription
Auto

The label alignment depends on the Axis2D.Alignment property value.

| | Center |

Axis labels are centered with major tickmarks.

| | Far |

Axis labels are displayed at the major tickmark right or top side in depending on axis type and orientation.

| | Near |

Axis labels are displayed at the major tickmark left or bottom side in depending on axis type and orientation.

|

Remarks

The following table lists values you can use to specify the LabelAlignment property.

ValueThe example image
Center
Far
Near

Example

This example illustrates how to configure the axis element appearance and layout:

The following markup configures options of a y-axis to resemble to its appearance in the image above:

xaml
<dxc:XYDiagram2D.AxisY>
    <dxc:AxisY2D TitlePosition="Outside" 
                 LabelPosition="Inside" 
                 LabelAlignment="Far"
                 Alignment="Near">
        <dxc:AxisY2D.NumericScaleOptions>
            <dxc:ContinuousNumericScaleOptions AutoGrid="False" 
                                               GridSpacing="10"/>
        </dxc:AxisY2D.NumericScaleOptions>
        <dxc:AxisY2D.WholeRange>
            <dxc:Range dxc:AxisY2D.AlwaysShowZeroLevel="False"/>
        </dxc:AxisY2D.WholeRange>
        <dxc:AxisY2D.Label>
            <dxc:AxisLabel TextPattern="{}{V} °F" 
                           FontSize="10"/>
        </dxc:AxisY2D.Label>
        <dxc:AxisY2D.Title>
            <dxc:AxisTitle Content="Temperature"  
                           Visible="True" 
                           Alignment="Center" 
                           FontSize="12"/>
        </dxc:AxisY2D.Title>
    </dxc:AxisY2D>
</dxc:XYDiagram2D.AxisY>

The following table lists the API members the example above uses:

MemberDescription
Axis2D.TitlePositionGets or sets the axis title position.
Axis2D.LabelPositionGets or sets the axis label position.
Axis2D.LabelAlignmentGets or sets the axis label alignment. This is a dependency property.
Axis2D.AlignmentGets or sets the axis alignment. This is a dependency property.
AxisY2D.NumericScaleOptionsProvides access to the options that define the behavior of a numeric Y-scale when its mode is continuous.
ContinuousNumericScaleOptionsContains settings for numeric axis data when its scale mode is continuous.
Axis.WholeRangeGets or sets the range through which it’s possible to scroll an axis.
RangeContains the common settings that define the range displayed by an axis.
AxisBase.LabelSpecifies axis label settings.
AxisLabelContains settings for axis labels.
Axis.TitleProvides access to the title settings of an axis.
AxisTitleDefines the common settings of an axis title.

See Also

Axis2D Class

Axis2D Members

DevExpress.Xpf.Charts Namespace