Back to Devexpress

IntervalNumericScaleOptions.GridLayoutMode Property

wpf-devexpress-dot-xpf-dot-charts-dot-intervalnumericscaleoptions-8bd7f997.md

latest6.0 KB
Original Source

IntervalNumericScaleOptions.GridLayoutMode Property

Gets or sets the value that specifies the alignment of grid lines, major tickmarks and axis labels.

Namespace : DevExpress.Xpf.Charts

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

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public GridLayoutMode GridLayoutMode { get; set; }
vb
Public Property GridLayoutMode As GridLayoutMode

Property Value

TypeDescription
GridLayoutMode

The value that specifies alignment.

|

Available values:

NameDescription
GridAndLabelCentered

A grid line, major tickmark, axis label are in an interval center.

| | GridShiftedLabelCentered |

A grid line and major tickmark are shifted to an interval start value. An axis label is in the interval center.

| | GridAndLabelShifted |

A grid line, major tickmark, axis label are shifted to an interval start value.

|

Remarks

The following alignments are available:

The GridLayoutMode valueImage
GridAndLabelCentered
GridAndLabelShifted
GridShiftedLabelCentered

When the GridAndLabelShifted mode is enabled, use the AxisLabel.TextPattern property to format the axis label text. Use the IntervalNumericScaleOptions.Pattern property when the GridAndLabelCentered or GridShiftedLabelCentered mode is enabled.

Example

This example demonstrates how to create a histogram chart with a given number of bins.

The code below configures a histogram for a chart with a numeric x-axis scale.

xaml
<dxc:ChartControl x:Name="chartControl">
    <dxc:XYDiagram2D>
        <dxc:XYDiagram2D.AxisX>
            <dxc:AxisX2D TickmarksMinorVisible="False" 
                         GridLinesVisible="True">
                <dxc:AxisX2D.NumericScaleOptions>
                    <!-- Configure a histogram chart with the specified number of bins. -->
                    <dxc:CountIntervalNumericScaleOptions AggregateFunction="Histogram" 
                                                          Count="5" 
                                                          GridLayoutMode="GridAndLabelShifted"/>
                    <!--...-->                                         
                </dxc:AxisX2D.NumericScaleOptions>
                <dxc:AxisX2D.Label>
                    <dxc:AxisLabel TextPattern="{}{A:F0}°C"/>
                </dxc:AxisX2D.Label>
                <dxc:AxisX2D.WholeRange>
                    <dxc:Range SideMarginsValue="0.8"/>
                </dxc:AxisX2D.WholeRange>
            </dxc:AxisX2D>
        </dxc:XYDiagram2D.AxisX>
        <dxc:BarSideBySideSeries2D DisplayName="Temperature" 
                                    DataSource="{Binding}" 
                                    ArgumentDataMember="Temperature" 
                                    BarWidth="1">
        </dxc:BarSideBySideSeries2D>
    </dxc:XYDiagram2D>
</dxc:ChartControl>

The following API members configure the histogram options:

MemberDescription
CountIntervalNumericScaleOptionsThe options that provide means to configure a specified number of axis intervals.
ManualNumericScaleOptions.AggregateFunctionGets or sets the function that is used to aggregate numeric axis data when one of the AxisX2D.NumericScaleOptions, AxisX3D.NumericScaleOptions, or CircularAxisX2D.NumericScaleOptions properties is set to ManualNumericScaleOptions.
CountIntervalNumericScaleOptions.CountGets or sets the number of intervals.
IntervalNumericScaleOptions.GridLayoutModeGets or sets the value that specifies the alignment of grid lines, major tickmarks and axis labels.

See Also

IntervalNumericScaleOptions Class

IntervalNumericScaleOptions Members

DevExpress.Xpf.Charts Namespace