Back to Devexpress

WidthIntervalNumericScaleOptions Class

wpf-devexpress-dot-xpf-dot-charts-8f88df45.md

latest7.6 KB
Original Source

WidthIntervalNumericScaleOptions Class

The options that provide means to create axis intervals with a specified width.

Namespace : DevExpress.Xpf.Charts

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

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public class WidthIntervalNumericScaleOptions :
    IntervalNumericScaleOptions
vb
Public Class WidthIntervalNumericScaleOptions
    Inherits IntervalNumericScaleOptions

Remarks

The AxisX2D.NumericScaleOptions property allows you to assign the WidthIntervalNumericScaleOptions object to the axis.

Use the Width property to specify the axis interval width. The number of intervals is automatically calculated.

To create a histogram with a given number of bins, use the CountIntervalNumericScaleOptions class.

Example

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

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 with the specified number of bins. -->
                    <dxc:WidthIntervalNumericScaleOptions AggregateFunction="Histogram" 
                                                          Width="10"
                                                          OverflowValue="20"
                                                          UnderflowValue="-30"
                                                          GridLayoutMode="GridAndLabelCentered"
                                                          Pattern="{}{OB}{A1:F0}; {A2:F0}{CB}"
                                                          OverflowValuePattern="{}{OS} {A1:F0}"
                                                          UnderflowValuePattern="{}{US} {A2:F0}"/>
                    <!--...-->                                                                  
                </dxc:AxisX2D.NumericScaleOptions>
                <dxc:AxisX2D.WholeRange>
                    <dxc:Range SideMarginsValue="0.8"/>
                </dxc:AxisX2D.WholeRange>
                <dxc:AxisX2D.Title>
                    <dxc:AxisTitle Content="Temperature (°C)" FontSize="14" Margin="0" Padding="0"/>
                </dxc:AxisX2D.Title>
            </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
WidthIntervalNumericScaleOptionsThe options that provide means to create axis intervals with a specified width.
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.
WidthIntervalNumericScaleOptions.WidthGets or sets the interval width in x-axis measurement units.
IntervalNumericScaleOptions.OverflowValueGets or sets the start value for the interval that includes overflow values.
IntervalNumericScaleOptions.UnderflowValueGets or sets the end value for the interval that includes underflow values.
IntervalNumericScaleOptions.GridLayoutModeGets or sets the value that specifies the alignment of grid lines, major tickmarks and axis labels.
IntervalNumericScaleOptions.PatternGets or sets a format string that configures text for the interval axis labels and crosshair labels.
IntervalNumericScaleOptions.OverflowValuePatternGets or sets a format string that configures text for the overflow interval axis labels and crosshair labels.
IntervalNumericScaleOptions.UnderflowValuePatternGets or sets a format string that configures text for the underflow interval axis labels and crosshair labels.

Inheritance

Show 11 items

Object DispatcherObject DependencyObject Freezable ChartDependencyObject ScaleOptionsBase NumericScaleOptionsBase NumericAggregationScaleOptionsBase ManualNumericScaleOptions IntervalNumericScaleOptions WidthIntervalNumericScaleOptions

See Also

WidthIntervalNumericScaleOptions Members

DevExpress.Xpf.Charts Namespace