Class NumericalAxis
The numerical axis uses a numerical scale and it displays numbers as labels. It supports both horizontal and vertical axes.
Inherited Members
Namespace: Syncfusion.Maui.Charts
Assembly: Syncfusion.Maui.Charts.dll
Syntax
public class NumericalAxis : RangeAxisBase, IThemeElementRemarks
To render an axis, the numerical axis instance to be added in chart’s XAxes and YAxes collection as per the following code snippet.
<chart:SfCartesianChart>
        <chart:SfCartesianChart.XAxes>
            <chart:NumericalAxis/>
        </chart:SfCartesianChart.XAxes>
        <chart:SfCartesianChart.YAxes>
            <chart:NumericalAxis/>
        </chart:SfCartesianChart.YAxes>
</chart:SfCartesianChart>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 IntervalPropertyField Value
| Type | 
|---|
| Microsoft.Maui.Controls.BindableProperty | 
MaximumProperty
Identifies the Maximum bindable property.
Declaration
public static readonly BindableProperty MaximumPropertyField Value
| Type | 
|---|
| Microsoft.Maui.Controls.BindableProperty | 
MinimumProperty
Identifies the Minimum bindable property.
Declaration
public static readonly BindableProperty MinimumPropertyField Value
| Type | 
|---|
| Microsoft.Maui.Controls.BindableProperty | 
PlotBandsProperty
Identifies the PlotBands bindable property.
Declaration
public static readonly BindableProperty PlotBandsPropertyField Value
| Type | 
|---|
| Microsoft.Maui.Controls.BindableProperty | 
RangePaddingProperty
Identifies the RangePadding bindable property.
Declaration
public static readonly BindableProperty RangePaddingPropertyField Value
| Type | 
|---|
| Microsoft.Maui.Controls.BindableProperty | 
Properties
ActualMaximum
Gets the actual maximum value of the NumericalAxis
Declaration
public double ActualMaximum { get; }Property Value
| Type | 
|---|
| System.Double | 
Examples
  <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>ActualMinimum
Gets the actual minimum value of the NumericalAxis
Declaration
public double ActualMinimum { get; }Property Value
| Type | 
|---|
| System.Double | 
Examples
  <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>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
<chart:SfCartesianChart>
        <chart:SfCartesianChart.XAxes>
            <chart:NumericalAxis Interval="10" />
        </chart:SfCartesianChart.XAxes>
</chart:SfCartesianChart>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
<chart:SfCartesianChart>
        <chart:SfCartesianChart.XAxes>
            <chart:NumericalAxis Maximum="100" Minimum="0"/>
        </chart:SfCartesianChart.XAxes>
</chart:SfCartesianChart>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
<chart:SfCartesianChart>
        <chart:SfCartesianChart.XAxes>
            <chart:NumericalAxis Maximum="100" Minimum="0"/>
        </chart:SfCartesianChart.XAxes>
</chart:SfCartesianChart>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 | 
Examples
<chart:SfCartesianChart>
    <chart:SfCartesianChart.XAxes>
        <chart:NumericalAxis>
           <chart:NumericalAxis.PlotBands>
               <chart:NumericalPlotBand Start="1" Width="2"/>
           </chart:NumericalAxis.PlotBands>
       </chart:NumericalAxis>
    </chart:SfCartesianChart.XAxes>
</chart:SfCartesianChart>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
<chart:SfCartesianChart>
        <chart:SfCartesianChart.XAxes>
            <chart:NumericalAxis RangePadding ="Round"/>
        </chart:SfCartesianChart.XAxes>
</chart:SfCartesianChart>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
CalculateActualInterval(DoubleRange, 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
CalculateActualRange()
Declaration
protected override DoubleRange CalculateActualRange()Returns
| Type | 
|---|
| DoubleRange | 
Overrides
CalculateVisibleRange(DoubleRange, Size)
Declaration
protected override DoubleRange CalculateVisibleRange(DoubleRange range, Size availableSize)Parameters
| Type | Name | Description | 
|---|---|---|
| DoubleRange | range | |
| Microsoft.Maui.Graphics.Size | availableSize | 
Returns
| Type | 
|---|
| DoubleRange |