Skip to main content

ManualNumericScaleOptions.GridAlignment Property

Gets or sets the numeric value to which the beginning of thegrid lines and axis labels of an axis should be aligned.

Namespace: DevExpress.Xpf.Charts

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

NuGet Package: DevExpress.Wpf.Charts

Declaration

public double GridAlignment { get; set; }

Property Value

Type Description
Double

A Double value to which the beginning of the gridlines and labels of an axis should be aligned.

Remarks

This property is available when one of the NumericScaleOptions properties (e.g., AxisX2D.NumericScaleOptions property) is set to ManualNumericScaleOptions.

The table below shows the GridAlignment property in action for random data.

GridAlignment = 1000, MeasureUnit=100 GridAlignment = 10000, MeasureUnit=100
NumericScaleOptions_GridAlignment1000 NumericScaleOptions_GridAlignment10000

To maintain numeric values at different detail levels, use the ManualNumericScaleOptions.MeasureUnit property.

Example

This example demonstrates how to use the manual numeric scale options of the X-axis.

When the AxisX2D.NumericScaleOptions property is set to ManualNumericScaleOptions, you can manually define the ManualNumericScaleOptions.GridAlignment, ManualNumericScaleOptions.MeasureUnit and ManualNumericScaleOptions.AggregateFunction properties.

To use the automatic numeric scale options, set the AxisX2D.NumericScaleOptions property to AutomaticNumericScaleOptions and choose the appropriate AutomaticNumericScaleOptions.AggregateFunction.

To prevent the axis scale from being divided into intervals (and thus prevent chart data from being aggregated), set the ManualNumericScaleOptions.AggregateFunction or AutomaticNumericScaleOptions.AggregateFunction property to None.

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts" 
    x:Class="AggregationNumericData.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <dxc:ChartControl >
            <dxc:ChartControl.Legend>
                <dxc:Legend/>
            </dxc:ChartControl.Legend>
            <dxc:XYDiagram2D>
                <dxc:XYDiagram2D.AxisX>
                    <dxc:AxisX2D GridLinesVisible="True">
                        <dxc:AxisX2D.NumericScaleOptions>
                            <dxc:ManualNumericScaleOptions MeasureUnit="100" GridAlignment="1000" 
                                                           AggregateFunction="Maximum" GridSpacing="2"/>
                        </dxc:AxisX2D.NumericScaleOptions>
                    </dxc:AxisX2D>
                </dxc:XYDiagram2D.AxisX>
                <dxc:LineSeries2D DataSource="{Binding Path=Series}" 
                                  ArgumentDataMember="Argument" ValueDataMember="Value"/>
            </dxc:XYDiagram2D>
        </dxc:ChartControl>
    </Grid>
</Window>
See Also