menu

WinUI

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

    Show / Hide Table of Contents

    Class LogarithmicAxis

    The logarithmic axis uses a logarithmic scale, ideal for displaying data with a wide range of values, and it displays logarithmically scaled numbers as labels.

    Inheritance
    System.Object
    ChartAxis
    RangeAxisBase
    LogarithmicAxis
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    ChartAxis.ActualRangeChanged
    ChartAxis.ApplyRangePadding(DoubleRange, Double)
    ChartAxis.AutoScrollingDelta
    ChartAxis.AutoScrollingDeltaProperty
    ChartAxis.AutoScrollingMode
    ChartAxis.AutoScrollingModeProperty
    ChartAxis.AxisLineOffset
    ChartAxis.AxisLineOffsetProperty
    ChartAxis.AxisLineStyle
    ChartAxis.AxisLineStyleProperty
    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 LogarithmicAxis : RangeAxisBase, INotifyPropertyChanged
    Remarks

    This axis can be oriented both horizontally and vertically. To render a logarithmic axis, create an instance of LogarithmicAxis and add it to the XAxes or YAxes collection as shown below.

    • MainPage.xaml
    • MainPage.xaml.cs
    <chart:SfCartesianChart>
    
            <chart:SfCartesianChart.XAxes>
                <chart:LogarithmicAxis LogarithmicBase="10"/>
            </chart:SfCartesianChart.XAxes>
    
            <chart:SfCartesianChart.YAxes>
                <chart:LogarithmicAxis LogarithmicBase="10"/>
            </chart:SfCartesianChart.YAxes>
    
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    LogarithmicAxis xAxis = new LogarithmicAxis() { LogarithmicBase = 10 };
    chart.XAxes.Add(xAxis);
    
    LogarithmicAxis yAxis = new LogarithmicAxis() { LogarithmicBase = 10 };
    chart.YAxes.Add(yAxis);

    Base Value - Set the logarithmic base with the LogarithmicBase property.

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

    Grid Lines - Customize major and minor grid lines using the ShowMajorGridLines, MajorGridLineStyle, MinorTicksPerInterval, and MinorGridLineStyle properties.

    Tick Lines - Customize major and minor tick lines using the MajorTickStyle, MinorTickStyle, and MinorTicksPerInterval properties.

    Axis Line - Customize the axis line with the AxisLineStyle property.

    Range Customization - Set a specific range using the Minimum and Maximum properties.

    Labels Customization - Customize labels using the LabelStyle property.

    Inversed Axis - Inverse the axis by setting the IsInversed property.

    Interval - Define the interval between labels with the Interval property for greater control over label placement.

    Constructors

    LogarithmicAxis()

    Initializes a new instance of the LogarithmicAxis class.

    Declaration
    public LogarithmicAxis()

    Fields

    IntervalProperty

    The DependencyProperty for Interval property.

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

    LogarithmicBaseProperty

    The DependencyProperty for LogarithmicBase property.

    Declaration
    public static readonly DependencyProperty LogarithmicBaseProperty
    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

    Properties

    ActualMaximum

    Gets the actual maximum value of the logarithmic 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:LogarithmicAxis x:Name="xAxis"/>
              </chart:SfCartesianChart.XAxes>
    
              <chart:SfCartesianChart.YAxes>
                  <chart:LogarithmicAxis x:Name="yAxis"/>
              </chart:SfCartesianChart.YAxes>
    
              <chart:SfCartesianChart.Series>
                  <chart:LineSeries   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);
    
        LineSeries series = new LineSeries();
        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
    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:SfCartesianChart.Series>
                  <chart:LineSeries   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);
    
        LineSeries series = new LineSeries();
        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

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

    LogarithmicBase

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

    Maximum

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

    Minimum

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

    Methods

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

    CalculateNiceInterval(DoubleRange, Size)

    Declaration
    protected override double CalculateNiceInterval(DoubleRange actualRange, Size availableSize)
    Parameters
    Type Name Description
    DoubleRange actualRange
    Windows.Foundation.Size availableSize
    Returns
    Type
    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
    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