CategoricalAxis
Represents a chart axis that plots one discrete category slot per data point, in source order, rather than positioning points along a continuous numeric or date-time scale. Use this axis type for bar, column, and line charts whose horizontal values are labels (or dates treated as labels) instead of measurable quantities.
When the bound category values need custom grouping or identity (for example bucketing date-time instances into calendar periods), set CategorySelector to derive the category value from each bound value. Use CategoryLabelFormat to control how that category value is rendered as a label.
Definition
Namespace:Telerik.Maui.Controls.Charts
Assembly:Telerik.Maui.Controls.dll
Syntax:
public sealed class CategoricalAxis : ChartAxis
Inheritance: objectChartAxisCategoricalAxis
Inherited Members
Constructors
public CategoricalAxis()
Fields
CategoryLabelFormatProperty
BindableProperty
Identifies the CategoryLabelFormat bindable property.
public static readonly BindableProperty CategoryLabelFormatProperty
CategorySelectorProperty
BindableProperty
Identifies the CategorySelector bindable property.
public static readonly BindableProperty CategorySelectorProperty
GapLengthProperty
BindableProperty
Identifies the GapLength bindable property.
public static readonly BindableProperty GapLengthProperty
PlotModeProperty
BindableProperty
Identifies the PlotMode bindable property.
public static readonly BindableProperty PlotModeProperty
Properties
Gets or sets the .NET custom or standard format string used to render category labels from the value produced by CategorySelector. Set to null (the default) to render labels using the category value's ToString() method.
public string? CategoryLabelFormat { get; set; }
Gets or sets the function used to derive the category value for each bound value. The chart engine invokes this function once per bound value to determine the value that identifies its category slot, passing both the resolved binding value and the source item via CategorySelectorContext. Set to null (the default) to use each bound value as its own category value.
public Func<CategorySelectorContext, object>? CategorySelector { get; set; }
Gets or sets the gap between adjacent category slots as a fraction of the slot width.
The value is in the [0, 1] range; defaults to 0.3.
public double GapLength { get; set; }
Gets or sets how data points are plotted relative to axis ticks. Use BetweenTicks to position points between adjacent ticks (typical for bar/column series), OnTicks to position points exactly on ticks with no outer padding, or OnTicksPadded (the default) to position points exactly on ticks while keeping the first/last points inset from the plot area edges.
public ChartAxisPlotMode PlotMode { get; set; }