Class LogarithmicAxis
Represents a specialized axis to plot data with number values on a logarithmic scale.
Inherited Members
Namespace: Syncfusion.Maui.Toolkit.Charts
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public class LogarithmicAxis : RangeAxisBase, IThemeElement
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
<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:LogarithmicAxis/>
</chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes>
<chart:LogarithmicAxis/>
</chart:SfCartesianChart.YAxes>
</chart:SfCartesianChart>
Constructors
LogarithmicAxis()
Declaration
public LogarithmicAxis()
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 logarithmic axis.
LogarithmicBaseProperty
Identifies the LogarithmicBase bindable property.
Declaration
public static readonly BindableProperty LogarithmicBaseProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
Defines the base of the logarithm for the logarithmic 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 logarithmic 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 logarithmic 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 logarithmic axis.
Properties
ActualMaximum
Gets the actual maximum value of the logarithmic axis
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: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>
ActualMinimum
Gets the actual minimum value of the logarithmic axis.
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: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>
Interval
Gets or sets the interval value that represents the number of divisions required in the logarithmic axis.
Declaration
public double Interval { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Defaults to double.NaN |
Remarks
Value must be greater than 0.
Examples
<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:CategoryAxis/>
</chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes>
<chart:LogarithmicAxis Interval="2"/>
</chart:SfCartesianChart.YAxes>
</chart:SfCartesianChart>
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
<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:CategoryAxis/>
</chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes>
<chart:LogarithmicAxis LogarithmicBase="10"/>
</chart:SfCartesianChart.YAxes>
</chart:SfCartesianChart>
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
<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:CategoryAxis/>
</chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes>
<chart:LogarithmicAxis Maximum="1000"/>
</chart:SfCartesianChart.YAxes>
</chart:SfCartesianChart>
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
<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:CategoryAxis/>
</chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes>
<chart:LogarithmicAxis Minimum="1"/>
</chart:SfCartesianChart.YAxes>
</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
Methods
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
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
CalculateNiceInterval(DoubleRange, Size)
Calculates the actual interval for the axis based on the provided range of values and the available size, ensuring appropriate spacing between axis labels or ticks.
Declaration
protected override double CalculateNiceInterval(DoubleRange actualRange, Size availableSize)
Parameters
Type | Name | Description |
---|---|---|
DoubleRange | actualRange | |
Microsoft.Maui.Graphics.Size | availableSize |
Returns
Type |
---|
System.Double |
Overrides
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 actualRange, Size availableSize)
Parameters
Type | Name | Description |
---|---|---|
DoubleRange | actualRange | |
Microsoft.Maui.Graphics.Size | availableSize |
Returns
Type |
---|
DoubleRange |