menu

WinUI

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class NumericalAxis - WinUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class NumericalAxis

    The numerical axis uses a numerical scale and it displays numbers as labels.

    Inheritance
    System.Object
    ChartAxis
    RangeAxisBase
    NumericalAxis
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    ChartAxis.ActualRangeChanged
    ChartAxis.AutoScrollingDelta
    ChartAxis.AutoScrollingDeltaProperty
    ChartAxis.AutoScrollingMode
    ChartAxis.AutoScrollingModeProperty
    ChartAxis.AxisLineOffset
    ChartAxis.AxisLineOffsetProperty
    ChartAxis.AxisLineStyle
    ChartAxis.AxisLineStyleProperty
    ChartAxis.CalculateNiceInterval(DoubleRange, Size)
    ChartAxis.CalculateVisibleInterval(DoubleRange, Size)
    ChartAxis.CrosshairLabelTemplate
    ChartAxis.CrosshairLabelTemplateProperty
    ChartAxis.EdgeLabelsDrawingMode
    ChartAxis.EdgeLabelsDrawingModeProperty
    ChartAxis.EnableAutoIntervalOnZooming
    ChartAxis.EnableAutoIntervalOnZoomingProperty
    ChartAxis.GetActualDesiredIntervalsCount(Size)
    ChartAxis.GetRenderedRect()
    ChartAxis.Header
    ChartAxis.HeaderProperty
    ChartAxis.HeaderStyle
    ChartAxis.HeaderStyleProperty
    ChartAxis.HeaderTemplate
    ChartAxis.HeaderTemplateProperty
    ChartAxis.IsInversed
    ChartAxis.IsInversedProperty
    ChartAxis.LabelCreated
    ChartAxis.LabelExtent
    ChartAxis.LabelExtentProperty
    ChartAxis.LabelRotation
    ChartAxis.LabelRotationProperty
    ChartAxis.LabelsIntersectAction
    ChartAxis.LabelsIntersectActionProperty
    ChartAxis.LabelStyle
    ChartAxis.LabelStyleProperty
    ChartAxis.LabelTemplate
    ChartAxis.LabelTemplateProperty
    ChartAxis.MajorGridLineStyle
    ChartAxis.MajorGridLineStyleProperty
    ChartAxis.MajorTickStyle
    ChartAxis.MajorTickStyleProperty
    ChartAxis.MeasureOverride(Size)
    ChartAxis.OnApplyTemplate()
    ChartAxis.OnCreateLabels()
    ChartAxis.OnLabelCreated(ChartAxisLabel)
    ChartAxis.OpposedPosition
    ChartAxis.OpposedPositionProperty
    ChartAxis.PlotOffsetEnd
    ChartAxis.PlotOffsetEndProperty
    ChartAxis.PlotOffsetStart
    ChartAxis.PlotOffsetStartProperty
    ChartAxis.PointToValue(Double, Double)
    ChartAxis.PropertyChanged
    ChartAxis.ShowMajorGridLines
    ChartAxis.ShowMajorGridLinesProperty
    ChartAxis.ShowTrackballLabel
    ChartAxis.ShowTrackballLabelProperty
    ChartAxis.TickLineSize
    ChartAxis.TickLineSizeProperty
    ChartAxis.TrackballLabelTemplate
    ChartAxis.TrackballLabelTemplateProperty
    ChartAxis.ValueToPoint(Double)
    ChartAxis.VisibleMaximum
    ChartAxis.VisibleMinimum
    ChartAxis.ZoomFactor
    ChartAxis.ZoomFactorProperty
    ChartAxis.ZoomPosition
    ChartAxis.ZoomPositionProperty
    RangeAxisBase.EdgeLabelsVisibilityMode
    RangeAxisBase.EdgeLabelsVisibilityModeProperty
    RangeAxisBase.MinorGridLineStyle
    RangeAxisBase.MinorGridLineStyleProperty
    RangeAxisBase.MinorTickLineSize
    RangeAxisBase.MinorTickLineSizeProperty
    RangeAxisBase.MinorTicksPerInterval
    RangeAxisBase.MinorTicksPerIntervalProperty
    RangeAxisBase.MinorTickStyle
    RangeAxisBase.MinorTickStyleProperty
    RangeAxisBase.ShowMinorGridLines
    RangeAxisBase.ShowMinorGridLinesProperty
    Namespace: Syncfusion.UI.Xaml.Charts
    Assembly: Syncfusion.Chart.WinUI.dll
    Syntax
    public class NumericalAxis : RangeAxisBase, INotifyPropertyChanged
    Remarks

    It supports both horizontal and vertical axes. To render an axis, create an instance of NumericalAxis and add it to the XAxes and YAxes collection.

    • MainPage.xaml
    • MainPage.xaml.cs
    <chart:SfCartesianChart>
    
            <chart:SfCartesianChart.XAxes>
                <chart:NumericalAxis/>
            </chart:SfCartesianChart.XAxes>
    
            <chart:SfCartesianChart.YAxes>
                <chart:NumericalAxis/>
            </chart:SfCartesianChart.YAxes>
    
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    NumericalAxis xaxis = new NumericalAxis();
    chart.XAxes.Add(xaxis);
    
    NumericalAxis yaxis = new NumericalAxis();
    chart.YAxes.Add(yaxis);

    Header - To render the header, refer to this Header property.

    Grid Lines - To show and customize the grid lines, refer to these ShowMajorGridLines, MajorGridLineStyle, MinorTicksPerInterval, and MinorGridLineStyle properties.

    Tick Lines - To show and customize the tick lines, refer to these MajorTickStyle, MinorTickStyle, and MinorTicksPerInterval properties.

    Axis Line - To customize the axis line using the AxisLineStyle property.

    Range Customization - To customize the axis range with help of the Minimum, and Maximum properties.

    Labels Customization - To customize the axis labels, refer to this LabelStyle property.

    Inversed Axis - Inverse the axis using the IsInversed property.

    Interval - Define the axis labels interval using the Interval property.

    Constructors

    NumericalAxis()

    Initializes a new instance of the NumericalAxis class.

    Declaration
    public NumericalAxis()

    Fields

    IntervalProperty

    The DependencyProperty for Interval property.

    Declaration
    public static readonly DependencyProperty IntervalProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    MaximumProperty

    The DependencyProperty for Maximum property.

    Declaration
    public static readonly DependencyProperty MaximumProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    MinimumProperty

    The DependencyProperty for Minimum property.

    Declaration
    public static readonly DependencyProperty MinimumProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    RangePaddingProperty

    The DependencyProperty for RangePadding property.

    Declaration
    public static readonly DependencyProperty RangePaddingProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    Properties

    ActualMaximum

    Gets the actual maximum value of the NumericalAxis

    Declaration
    public double ActualMaximum { get; }
    Property Value
    Type
    System.Double
    Examples
    • MainWindow.xaml
    • MainWindow.cs
      <StackPanel>
         <TextBlock Text="{Binding ElementName=xAxis, Path=ActualMaximum, Mode=TwoWay}" />
        <chart:SfCartesianChart>
    
              <chart:SfCartesianChart.XAxes>
                  <chart:NumericalAxis x:Name="xAxis"/>
              </chart:SfCartesianChart.XAxes>
    
              <chart:SfCartesianChart.YAxes>
                  <chart:NumericalAxis x:Name="yAxis"/>
              </chart:SfCartesianChart.YAxes>
    
              <chart:SfCartesianChart.Series>
                  <chart:ColumnSeries ItemsSource="{Binding Data}"
                                      XBindingPath="XValue"
                                      YBindingPath="YValue" />
              </chart:SfCartesianChart.Series>
    
        </chart:SfCartesianChart>
      </StackPanel>
        SfCartesianChart chart = new SfCartesianChart();
    
        NumericalAxis xAxis = new NumericalAxis();
        NumericalAxis yAxis = new NumericalAxis();
    
        chart.XAxes.Add(xAxis);
        chart.YAxes.Add(yAxis);
    
        ColumnSeries series = new ColumnSeries();
        series.ItemsSource = viewmodel.Data;
        series.XBindingPath = "XValue";
        series.YBindingPath = "YValue";
        chart.Series.Add(series);
    
        TextBlock textBlock = new TextBlock();
        Binding binding = new Binding();
        binding.Source = xAxis;
        binding.Path = new PropertyPath("ActualMaximum");
        textBlock.SetBinding(TextBlock.TextProperty, binding);

    ActualMinimum

    Gets the actual minimum value of the NumericalAxis

    Declaration
    public double ActualMinimum { get; }
    Property Value
    Type
    System.Double
    Examples
    • MainWindow.xaml
    • MainWindow.cs
      <StackPanel>
         <TextBlock Text="{Binding ElementName=xAxis, Path=ActualMinimum, Mode=TwoWay}" />
        <chart:SfCartesianChart>
    
              <chart:SfCartesianChart.XAxes>
                  <chart:NumericalAxis x:Name="xAxis"/>
              </chart:SfCartesianChart.XAxes>
    
              <chart:SfCartesianChart.YAxes>
                  <chart:NumericalAxis x:Name="yAxis"/>
              </chart:SfCartesianChart.YAxes>
    
              <chart:SfCartesianChart.Series>
                  <chart:ColumnSeries ItemsSource="{Binding Data}"
                                      XBindingPath="XValue"
                                      YBindingPath="YValue" />
              </chart:SfCartesianChart.Series>
    
        </chart:SfCartesianChart>
      </StackPanel>
        SfCartesianChart chart = new SfCartesianChart();
    
        NumericalAxis xAxis = new NumericalAxis();
        NumericalAxis yAxis = new NumericalAxis();
    
        chart.XAxes.Add(xAxis);
        chart.YAxes.Add(yAxis);
    
        ColumnSeries series = new ColumnSeries();
        series.ItemsSource = viewmodel.Data;
        series.XBindingPath = "XValue";
        series.YBindingPath = "YValue";
        chart.Series.Add(series);
    
        TextBlock textBlock = new TextBlock();
        Binding binding = new Binding();
        binding.Source = xAxis;
        binding.Path = new PropertyPath("ActualMinimum");
        textBlock.SetBinding(TextBlock.TextProperty, binding);

    Interval

    Gets or sets a value that determines the interval in axis's range.

    Declaration
    public double Interval { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is double.NaN.

    Remarks

    If this property is not set, the interval will be calculated automatically.

    Examples
    • MainPage.xaml
    • MainPage.xaml.cs
    <chart:SfCartesianChart>
    
            <chart:SfCartesianChart.XAxes>
                <chart:NumericalAxis Interval="10" />
            </chart:SfCartesianChart.XAxes>
    
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    NumericalAxis xaxis = new NumericalAxis();
    xaxis.Interval = 10;
    chart.XAxes.Add(xaxis);	

    Maximum

    Gets or sets the maximum value for the axis range.

    Declaration
    public double Maximum { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is double.NaN.

    Remarks

    If we didn't set the maximum value, it will be calculated from the underlying collection.

    Examples
    • MainPage.xaml
    • MainPage.xaml.cs
    <chart:SfCartesianChart>
    
            <chart:SfCartesianChart.XAxes>
                <chart:NumericalAxis Maximum="100" Minimum="0"/>
            </chart:SfCartesianChart.XAxes>
    
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    NumericalAxis xaxis = new NumericalAxis()
    {
        Maximum = 100,
        Minimum = 0,
    };
    chart.XAxes.Add(xaxis);	

    Minimum

    Gets or sets the minimum value for the axis range.

    Declaration
    public double Minimum { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is double.NaN.

    Remarks

    If we didn't set the minimum value, it will be calculated from the underlying collection.

    Examples
    • MainPage.xaml
    • MainPage.xaml.cs
    <chart:SfCartesianChart>
    
            <chart:SfCartesianChart.XAxes>
                <chart:NumericalAxis Maximum="100" Minimum="0"/>
            </chart:SfCartesianChart.XAxes>
    
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    NumericalAxis xaxis = new NumericalAxis()
    {
        Maximum = 100,
        Minimum = 0,
    };
    chart.XAxes.Add(xaxis);	

    RangePadding

    Gets or sets a padding type for the numerical axis range.

    Declaration
    public NumericalPadding RangePadding { get; set; }
    Property Value
    Type Description
    NumericalPadding

    It accepts the NumericalPadding value and its default value is Auto.

    Examples
    • MainPage.xaml
    • MainPage.xaml.cs
    <chart:SfCartesianChart>
    
            <chart:SfCartesianChart.XAxes>
                <chart:NumericalAxis RangePadding ="Round"/>
            </chart:SfCartesianChart.XAxes>
    
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    NumericalAxis xaxis = new NumericalAxis()
    {
        RangePadding = NumericalPadding.Round,
    };
    chart.XAxes.Add(xaxis);

    Methods

    ApplyRangePadding(DoubleRange, Double)

    Declaration
    protected override DoubleRange ApplyRangePadding(DoubleRange range, double interval)
    Parameters
    Type Name Description
    DoubleRange range
    System.Double interval
    Returns
    Type
    DoubleRange
    Overrides
    ChartAxis.ApplyRangePadding(DoubleRange, Double)

    CalculateActualInterval(DoubleRange, Size)

    Declaration
    protected override double CalculateActualInterval(DoubleRange range, Size availableSize)
    Parameters
    Type Name Description
    DoubleRange range
    Windows.Foundation.Size availableSize
    Returns
    Type
    System.Double
    Overrides
    ChartAxis.CalculateActualInterval(DoubleRange, Size)

    CalculateActualRange()

    Declaration
    protected override DoubleRange CalculateActualRange()
    Returns
    Type
    DoubleRange
    Overrides
    ChartAxis.CalculateActualRange()

    CalculateVisibleRange(DoubleRange, Size)

    Declaration
    protected override DoubleRange CalculateVisibleRange(DoubleRange range, Size availableSize)
    Parameters
    Type Name Description
    DoubleRange range
    Windows.Foundation.Size availableSize
    Returns
    Type
    DoubleRange
    Overrides
    ChartAxis.CalculateVisibleRange(DoubleRange, Size)

    Implements

    System.ComponentModel.INotifyPropertyChanged
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved