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.
Implements
Inherited Members
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.
<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:LogarithmicAxis LogarithmicBase="10"/>
</chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes>
<chart:LogarithmicAxis LogarithmicBase="10"/>
</chart:SfCartesianChart.YAxes>
</chart:SfCartesianChart>
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
<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>
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:SfCartesianChart.Series>
<chart:LineSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue" />
</chart:SfCartesianChart.Series>
</chart:SfCartesianChart>
</VerticalStackLayout>
Interval
Gets or sets the interval between labels along the logarithmic axis. If not set, the interval is automatically calculated based on the axis range and base value.
Declaration
public double Interval { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is double.NaN. |
Examples
<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:LogarithmicAxis Interval="2" />
</chart:SfCartesianChart.XAxes>
</chart:SfCartesianChart>
LogarithmicBase
Gets or sets the base value for the logarithmic calculations on the axis. This defines the logarithmic scale used to display data values.
Declaration
public double LogarithmicBase { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is 10. |
Examples
<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:LogarithmicAxis LogarithmicBase="2" />
</chart:SfCartesianChart.XAxes>
</chart:SfCartesianChart>
Maximum
Gets or sets the maximum value displayed on the logarithmic axis. If not set, the maximum value is calculated based on the data.
Declaration
public double Maximum { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is null. |
Examples
<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:LogarithmicAxis Maximum="10000" />
</chart:SfCartesianChart.XAxes>
</chart:SfCartesianChart>
Minimum
Gets or sets the minimum value displayed on the logarithmic axis. If not set, the minimum value is calculated based on the data.
Declaration
public double Minimum { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is null. |
Examples
<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:LogarithmicAxis Minimum="1" />
</chart:SfCartesianChart.XAxes>
</chart:SfCartesianChart>
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
CalculateActualRange()
Declaration
protected override DoubleRange CalculateActualRange()
Returns
Type |
---|
DoubleRange |
Overrides
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
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 |