menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class LogarithmicAxis - API Reference

    Show / Hide Table of Contents

    Class LogarithmicAxis

    Represents a specialized axis to plot data with number values on a logarithmic scale.

    Inheritance
    System.Object
    ChartAxis
    RangeAxisBase
    LogarithmicAxis
    Inherited Members
    RangeAxisBase.MinorTicksPerIntervalProperty
    RangeAxisBase.EdgeLabelsVisibilityModeProperty
    RangeAxisBase.MinorGridLineStyleProperty
    RangeAxisBase.MinorTickStyleProperty
    RangeAxisBase.ShowMinorGridLinesProperty
    RangeAxisBase.OnBindingContextChanged()
    RangeAxisBase.EdgeLabelsVisibilityMode
    RangeAxisBase.MinorTicksPerInterval
    RangeAxisBase.MinorGridLineStyle
    RangeAxisBase.MinorTickStyle
    RangeAxisBase.ShowMinorGridLines
    ChartAxis.IsVisibleProperty
    ChartAxis.AxisLineOffsetProperty
    ChartAxis.LabelRotationProperty
    ChartAxis.LabelStyleProperty
    ChartAxis.AxisLineStyleProperty
    ChartAxis.CrossesAtProperty
    ChartAxis.RenderNextToCrossingValueProperty
    ChartAxis.CrossAxisNameProperty
    ChartAxis.TitleProperty
    ChartAxis.IsInversedProperty
    ChartAxis.EdgeLabelsDrawingModeProperty
    ChartAxis.MajorGridLineStyleProperty
    ChartAxis.MajorTickStyleProperty
    ChartAxis.ZoomPositionProperty
    ChartAxis.ZoomFactorProperty
    ChartAxis.ShowMajorGridLinesProperty
    ChartAxis.NameProperty
    ChartAxis.PlotOffsetStartProperty
    ChartAxis.PlotOffsetEndProperty
    ChartAxis.EnableAutoIntervalOnZoomingProperty
    ChartAxis.ShowTrackballLabelProperty
    ChartAxis.TrackballLabelStyleProperty
    ChartAxis.AutoScrollingModeProperty
    ChartAxis.AutoScrollingDeltaProperty
    ChartAxis.LabelExtentProperty
    ChartAxis.ValueToPoint(Double)
    ChartAxis.PointToValue(Double, Double)
    ChartAxis.GetActualDesiredIntervalsCount(Size)
    ChartAxis.ApplyRangePadding(DoubleRange, Double)
    ChartAxis.OnLabelCreated(ChartAxisLabel)
    ChartAxis.CalculateVisibleInterval(DoubleRange, Size)
    ChartAxis.ComputeDesiredSize(Size)
    ChartAxis.DrawAxis(ICanvas, Rect)
    ChartAxis.DrawMajorTick(ICanvas, Double, PointF, PointF)
    ChartAxis.DrawMinorTick(ICanvas, Double, PointF, PointF)
    ChartAxis.DrawAxisLine(ICanvas, Single, Single, Single, Single)
    ChartAxis.DrawGridLine(ICanvas, Double, Single, Single, Single, Single)
    ChartAxis.OnParentSet()
    ChartAxis.IsVisible
    ChartAxis.PlotOffsetStart
    ChartAxis.PlotOffsetEnd
    ChartAxis.AxisLineOffset
    ChartAxis.LabelRotation
    ChartAxis.LabelStyle
    ChartAxis.AxisLineStyle
    ChartAxis.CrossesAt
    ChartAxis.RenderNextToCrossingValue
    ChartAxis.CrossAxisName
    ChartAxis.Title
    ChartAxis.IsInversed
    ChartAxis.EdgeLabelsDrawingMode
    ChartAxis.MajorGridLineStyle
    ChartAxis.MajorTickStyle
    ChartAxis.ZoomPosition
    ChartAxis.ZoomFactor
    ChartAxis.ShowMajorGridLines
    ChartAxis.EnableAutoIntervalOnZooming
    ChartAxis.ShowTrackballLabel
    ChartAxis.TrackballLabelStyle
    ChartAxis.AutoScrollingDelta
    ChartAxis.AutoScrollingMode
    ChartAxis.Name
    ChartAxis.LabelExtent
    ChartAxis.LabelCreated
    ChartAxis.ActualRangeChanged
    Namespace: Syncfusion.Maui.Charts
    Assembly: Syncfusion.Maui.Charts.dll
    Syntax
    public class LogarithmicAxis : RangeAxisBase
    Remarks

    This class contains properties to customize range, interval, grid lines, ticks, and labels.

    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 - Define the axis labels interval using the Interval property.

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

    Constructors

    LogarithmicAxis()

    Declaration
    public LogarithmicAxis()

    Fields

    IntervalProperty

    Identifies the Interval bindable property.

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

    LogarithmicBaseProperty

    Identifies the LogarithmicBase bindable property.

    Declaration
    public static readonly BindableProperty LogarithmicBaseProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    MaximumProperty

    Identifies the Maximum bindable property.

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

    MinimumProperty

    Identifies the Minimum bindable property.

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

    Properties

    ActualMaximum

    Gets the actual maximum value of the logarithmic axis

    Declaration
    public double ActualMaximum { get; }
    Property Value
    Type Description
    System.Double
    Examples
    • MainWindow.xaml
    • MainWindow.cs
      <VerticalStackLayout>
        <Label Text="{Binding Source={x:Reference xAxis}, Path=ActualMaximum }" />
        <chart:SfCartesianChart>
    
              <chart:SfCartesianChart.XAxes>
                  <chart:LogarithmicAxis x:Name="xAxis"/>
              </chart:SfCartesianChart.XAxes>
    
              <chart:SfCartesianChart.YAxes>
                  <chart:LogarithmicAxis 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();
    
        LogarithmicAxis xAxis = new LogarithmicAxis();
        LogarithmicAxis yAxis = new LogarithmicAxis();
    
        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 logarithmic axis.

    Declaration
    public double ActualMinimum { get; }
    Property Value
    Type Description
    System.Double
    Examples
    • MainWindow.xaml
    • MainWindow.cs
      <VerticalStackLayout>
        <Label Text="{Binding Source={x:Reference xAxis}, Path=ActualMinimum }" />
        <chart:SfCartesianChart>
    
              <chart:SfCartesianChart.XAxes>
                  <chart:LogarithmicAxis x:Name="xAxis"/>
              </chart:SfCartesianChart.XAxes>
    
              <chart:SfCartesianChart.YAxes>
                  <chart:LogarithmicAxis x:Name="yAxis"/>
              </chart:SfCartesianChart.YAxes>
    
                  <chart:ColumnSeries ItemsSource="{Binding Data}" 
                                      XBindingPath="XValue"
                                      YBindingPath="YValue" />
    
        </chart:SfCartesianChart>
      </VerticalStackLayout>
        SfCartesianChart chart = new SfCartesianChart();
    
        LogarithmicAxis xAxis = new LogarithmicAxis();
        LogarithmicAxis yAxis = new LogarithmicAxis();
    
        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 the interval value that represents the number of divisions required in the LogarithmicAxis.

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

    Defaults to double.NaN

    Remarks

    Value must be greater than 0.

    Examples
    • MainPage.xaml
    • MainPage.xaml.cs
    <chart:SfCartesianChart>
       <chart:SfCartesianChart.XAxes>
           <chart:CategoryAxis/>
       </chart:SfCartesianChart.XAxes>
       <chart:SfCartesianChart.YAxes>
           <chart:LogarithmicAxis Interval="2"/>
       </chart:SfCartesianChart.YAxes>
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    ViewModel viewModel = new ViewModel();
    chart.BindingContext = viewModel;
    
    LogarithmicAxis yaxis = new LogarithmicAxis();
    yaxis.Interval = 2;
    chart.YAxes.Add(yaxis);

    LogarithmicBase

    Gets or sets the logarithmic base value for the axis.

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

    Default value is 10.

    Remarks

    The value cannot be less than 2.

    Examples
    • MainPage.xaml
    • MainPage.xaml.cs
    <chart:SfCartesianChart>
       <chart:SfCartesianChart.XAxes>
           <chart:CategoryAxis/>
       </chart:SfCartesianChart.XAxes>
       <chart:SfCartesianChart.YAxes>
           <chart:LogarithmicAxis LogarithmicBase="10"/>
       </chart:SfCartesianChart.YAxes>
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    ViewModel viewModel = new ViewModel();
    chart.BindingContext = viewModel;
    
    LogarithmicAxis yaxis = new LogarithmicAxis();
    yaxis.LogarithmicBase = 10;
    chart.YAxes.Add(yaxis);	

    Maximum

    Gets or sets the maximum value of the visible range to be displayed on chart axis.

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

    Defaults to null

    Remarks

    The value must be greater than 1.

    Examples
    • MainPage.xaml
    • MainPage.xaml.cs
    <chart:SfCartesianChart>
       <chart:SfCartesianChart.XAxes>
           <chart:CategoryAxis/>
       </chart:SfCartesianChart.XAxes>
       <chart:SfCartesianChart.YAxes>
           <chart:LogarithmicAxis Maximum="1000"/>
       </chart:SfCartesianChart.YAxes>
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    ViewModel viewModel = new ViewModel();
    chart.BindingContext = viewModel;
    
    LogarithmicAxis yaxis = new LogarithmicAxis();
    yaxis.Maximum = 1000;
    chart.YAxes.Add(yaxis);	

    Minimum

    Gets or sets the minimum value of visible range to be displayed on chart axis.

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

    Defaults to null

    Remarks

    The value must be greater than 0.

    Examples
    • MainPage.xaml
    • MainPage.xaml.cs
    <chart:SfCartesianChart>
       <chart:SfCartesianChart.XAxes>
           <chart:CategoryAxis/>
       </chart:SfCartesianChart.XAxes>
       <chart:SfCartesianChart.YAxes>
           <chart:LogarithmicAxis Minimum="1"/>
       </chart:SfCartesianChart.YAxes>
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    ViewModel viewModel = new ViewModel();
    chart.BindingContext = viewModel;
    
    LogarithmicAxis yaxis = new LogarithmicAxis();
    yaxis.Minimum = 1;
    chart.YAxes.Add(yaxis);	

    Methods

    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 Description
    System.Double
    Overrides
    ChartAxis.CalculateActualInterval(DoubleRange, Size)

    CalculateActualRange()

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

    CalculateNiceInterval(DoubleRange, Size)

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

    CalculateVisibleRange(DoubleRange, Size)

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