Skip to main content

NumericChartRangeControlClient.GridAlignment Property

Gets or sets the numeric unit for the numeric chart client to which the chart’s gridlines and labels should be aligned.

Namespace: DevExpress.Xpf.Charts.RangeControlClient

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

Declaration

public double GridAlignment { get; set; }

Property Value

Type Description
Double

A Double value which specifies the grid alignment for the numeric chart range control client.

Remarks

This setting is in effect if the ChartRangeControlClientBase.ShowGridLines property is set to true.

The following images demonstrate the GridAlignment property in action for the random function.

GridAlignment= 4 GridAlignment = 9
NumericChartClient_GridAlignment_4 NumericChartClient_GridAlignment_9

Note that the ChartRangeControlClient.GridSpacing property affects GridAlignment, as shown in the images below.

GridAlignment= 4, GridSpacing= 1 GridAlignment = 4, GridSpacing= 3
NumericChartClient_GridAlignment_4 NumericClientGridAlignment_4_GridSpacing_3

Example

This example demonstrates how to set up a range control with the numeric chart client to display a chart with numeric data in the range control’s background.

Usually, in order to provide data to a chart numeric range control client, you need to specify a datasource using the ChartRangeControlClient.ItemsSource property and specify the required data fields via ChartRangeControlClient.ArgumentDataMember and ChartRangeControlClient.ValueDataMember properties (for more information, see the How to: Bind a Numeric Chart Range Control Client to a List of Custom Objects example). Note that when the ArgumentDataMember property is specified, chart points are sorted by arguments in the ascending order.

In the current example, a numeric chart client is bound to an array of integers using the ItemsSource property. In addition, you can bind a numeric chart client to other simple type objects (short, integer, long, double, decimal, float types , etc.). In this scenario the data values are shown in the same order in which elements have been added to the array.

View Example

Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Windows

Namespace NumericRangeControlClient

    Partial Public Class MainWindow
        Inherits Window

        Private dataArray() As Integer = { 0, 4, 2, 5, 4, 5, 3, 4, 8, 9, 10 }

        Public Sub New()
            InitializeComponent()
            DataContext = dataArray
        End Sub
    End Class
End Namespace
See Also