menu

MAUI Toolkit

  • User Guide
  • Demos
  • Support
Class NumericalAxis - MAUI-ToolKit API Reference | Syncfusion

    Show / Hide Table of Contents

    Class NumericalAxis

    The numerical axis uses a numerical scale and it displays numbers as labels. It supports both horizontal and vertical axes.

    Inheritance
    System.Object
    ChartAxis
    RangeAxisBase
    NumericalAxis
    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.ComputeDesiredSize(Size)
    ChartAxis.CrossAxisName
    ChartAxis.CrossAxisNameProperty
    ChartAxis.CrossesAt
    ChartAxis.CrossesAtProperty
    ChartAxis.DrawAxis(ICanvas, Rect)
    ChartAxis.DrawAxisLine(ICanvas, Single, Single, Single, Single)
    ChartAxis.DrawGridLine(ICanvas, Double, Single, Single, Single, Single)
    ChartAxis.DrawMajorTick(ICanvas, Double, PointF, PointF)
    ChartAxis.DrawMinorTick(ICanvas, Double, PointF, PointF)
    ChartAxis.EdgeLabelsDrawingMode
    ChartAxis.EdgeLabelsDrawingModeProperty
    ChartAxis.EnableAutoIntervalOnZooming
    ChartAxis.EnableAutoIntervalOnZoomingProperty
    ChartAxis.GetActualDesiredIntervalsCount(Size)
    ChartAxis.IsInversed
    ChartAxis.IsInversedProperty
    ChartAxis.IsVisible
    ChartAxis.IsVisibleProperty
    ChartAxis.LabelCreated
    ChartAxis.LabelExtent
    ChartAxis.LabelExtentProperty
    ChartAxis.LabelRotation
    ChartAxis.LabelRotationProperty
    ChartAxis.LabelsIntersectAction
    ChartAxis.LabelsIntersectActionProperty
    ChartAxis.LabelsPosition
    ChartAxis.LabelsPositionProperty
    ChartAxis.LabelStyle
    ChartAxis.LabelStyleProperty
    ChartAxis.MajorGridLineStyle
    ChartAxis.MajorGridLineStyleProperty
    ChartAxis.MajorTickStyle
    ChartAxis.MajorTickStyleProperty
    ChartAxis.MaximumLabels
    ChartAxis.MaximumLabelsProperty
    ChartAxis.Name
    ChartAxis.NameProperty
    ChartAxis.OnCreateLabels()
    ChartAxis.OnLabelCreated(ChartAxisLabel)
    ChartAxis.PlotOffsetEnd
    ChartAxis.PlotOffsetEndProperty
    ChartAxis.PlotOffsetStart
    ChartAxis.PlotOffsetStartProperty
    ChartAxis.PointToValue(Double, Double)
    ChartAxis.RenderNextToCrossingValue
    ChartAxis.RenderNextToCrossingValueProperty
    ChartAxis.ShowMajorGridLines
    ChartAxis.ShowMajorGridLinesProperty
    ChartAxis.ShowTrackballLabel
    ChartAxis.ShowTrackballLabelProperty
    ChartAxis.TickPosition
    ChartAxis.TickPositionProperty
    ChartAxis.Title
    ChartAxis.TitleProperty
    ChartAxis.TrackballLabelStyle
    ChartAxis.TrackballLabelStyleProperty
    ChartAxis.TrackballLabelTemplate
    ChartAxis.TrackballLabelTemplateProperty
    ChartAxis.ValueToPoint(Double)
    ChartAxis.VisibleLabels
    ChartAxis.VisibleMaximum
    ChartAxis.VisibleMinimum
    ChartAxis.ZoomFactor
    ChartAxis.ZoomFactorProperty
    ChartAxis.ZoomPosition
    ChartAxis.ZoomPositionProperty
    RangeAxisBase.EdgeLabelsVisibilityMode
    RangeAxisBase.EdgeLabelsVisibilityModeProperty
    RangeAxisBase.MinorGridLineStyle
    RangeAxisBase.MinorGridLineStyleProperty
    RangeAxisBase.MinorTicksPerInterval
    RangeAxisBase.MinorTicksPerIntervalProperty
    RangeAxisBase.MinorTickStyle
    RangeAxisBase.MinorTickStyleProperty
    RangeAxisBase.ShowMinorGridLines
    RangeAxisBase.ShowMinorGridLinesProperty
    Namespace: Syncfusion.Maui.Toolkit.Charts
    Assembly: Syncfusion.Maui.Toolkit.dll
    Syntax
    public class NumericalAxis : RangeAxisBase, IThemeElement
    Remarks

    To render an axis, the numerical axis instance to be added in chart’s XAxes and YAxes collection as per the following code snippet.

    • 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);

    Title - To render the title, refer to this Title property.

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

    Tick Lines - To show and customize the tick lines refer these MajorTickStyle, MinorTickStyle, 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.

    Axis Crossing - For axis crossing, refer these CrossesAt, CrossAxisName, and RenderNextToCrossingValue properties.

    Interval - To define the axis labels interval using the Interval property.

    Constructors

    NumericalAxis()

    Declaration
    public NumericalAxis()

    Fields

    IntervalProperty

    Identifies the Interval bindable property.

    Declaration
    public static readonly BindableProperty IntervalProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    Defines the interval value for the numerical axis.

    MaximumProperty

    Identifies the Maximum bindable property.

    Declaration
    public static readonly BindableProperty MaximumProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    Defines the maximum value for the numerical axis.

    MinimumProperty

    Identifies the Minimum bindable property.

    Declaration
    public static readonly BindableProperty MinimumProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    Defines the minimum value for the numerical axis.

    PlotBandsProperty

    Identifies the PlotBands bindable property.

    Declaration
    public static readonly BindableProperty PlotBandsProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    Defines the collection of plot bands for the numerical axis.

    RangePaddingProperty

    Identifies the RangePadding bindable property.

    Declaration
    public static readonly BindableProperty RangePaddingProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    Defines the padding for the numerical axis range.

    Properties

    ActualMaximum

    Gets the actual maximum value of the numerical axis.

    Declaration
    public double ActualMaximum { get; }
    Property Value
    Type
    System.Double
    Examples
    • MainWindow.xaml
    • MainWindow.cs
      <VerticalStackLayout>
        <Label Text="{Binding Source={x:Reference xAxis}, Path=ActualMaximum }" />
        <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>
      </VerticalStackLayout>
        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);
    
        Label label = new Label();
        label.SetBinding(Label.TextProperty, new Binding("ActualMaximum", source: xAxis));

    ActualMinimum

    Gets the actual minimum value of the numerical axis.

    Declaration
    public double ActualMinimum { get; }
    Property Value
    Type
    System.Double
    Examples
    • MainWindow.xaml
    • MainWindow.cs
      <VerticalStackLayout>
        <Label Text="{Binding Source={x:Reference xAxis}, Path=ActualMinimum }" />
        <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>
      </VerticalStackLayout>
        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);
    
        Label label = new Label();
        label.SetBinding(Label.TextProperty, new Binding("ActualMinimum", source: xAxis));

    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 Nullable<double> Maximum { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Double>

    It accepts double values and the default value is null.

    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 Nullable<double> Minimum { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Double>

    It accepts double values and the default value is null.

    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);	

    PlotBands

    Gets or sets the collection of plot bands to be added to the chart axis.

    Declaration
    public NumericalPlotBandCollection PlotBands { get; set; }
    Property Value
    Type
    NumericalPlotBandCollection

    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)

    Determines whether padding is applied to the axis range, typically used to add space between the plotted data points and the axis edges.

    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)

    Determines the actual interval between axis labels or gridlines based on the axis range and chart size.

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

    CalculateActualRange()

    Calculates the actual range of values for an axis based on the data points and axis settings.

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

    CalculateVisibleRange(DoubleRange, Size)

    Computes the range of values currently visible on the axis, typically after zooming or panning operations.

    Declaration
    protected override DoubleRange CalculateVisibleRange(DoubleRange range, Size availableSize)
    Parameters
    Type Name Description
    DoubleRange range
    Microsoft.Maui.Graphics.Size availableSize
    Returns
    Type
    DoubleRange
    Overrides
    ChartAxis.CalculateVisibleRange(DoubleRange, Size)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved