ClassChartCategoryAxisLabels
Configures the appearance and behavior of category axis labels in charts. Controls label formatting, positioning, rotation, and styling for the X-axis categories. Essential for customizing how category names, dates, or values appear along the horizontal axis. Children: ChartCategoryAxisLabelsBorder, ChartCategoryAxisLabelsMargin, ChartCategoryAxisLabelsPadding, ChartCategoryAxisLabelsRotation.
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Syntax:
public class ChartCategoryAxisLabels : DataVizChildComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseDataVizChildComponentChartCategoryAxisLabels
Implements:
Inherited Members
Constructors
ChartCategoryAxisLabels()
Declaration
public ChartCategoryAxisLabels()
Properties
Background
Sets the background color for category axis labels using any valid CSS color. Examples: "#F8F9FA", "rgba(248, 249, 250, 0.8)", "lightgray". Use semi-transparent colors to create subtle label highlighting without blocking chart content. Helps improve label readability when positioned over busy chart backgrounds. When not set, labels have transparent backgrounds.
Declaration
[Parameter]
public string Background { get; set; }
Property Value
ChildContent
The content of the ChartCategoryAxisLabels component. Children: ChartCategoryAxisLabelsBorder, ChartCategoryAxisLabelsMargin, ChartCategoryAxisLabelsPadding, ChartCategoryAxisLabelsRotation.
Declaration
[Parameter]
public RenderFragment ChildContent { get; set; }
Property Value
Color
Sets the text color for category axis labels using any valid CSS color. Examples: "#333333", "rgb(51, 51, 51)", "darkblue", "var(--primary-color)". Choose colors that provide sufficient contrast against the chart background for accessibility. Use theme-consistent colors to maintain visual harmony with your application design. When not specified, uses the default theme color for optimal readability.
Font
Defines the font styling for category axis labels using standard CSS font syntax. Examples: "14px Arial", "bold 16px 'Segoe UI'", "italic 12px sans-serif". Combine font-weight, font-size, and font-family for complete typography control. Use web-safe fonts or font stacks to ensure consistent rendering across devices. When not specified, inherits font settings from the current theme.
Format
Controls how category values are formatted for display using Kendo formatting patterns. Use "{0:yyyy-MM-dd}" for date formatting, "{0:C}" for currency, "{0:P}" for percentages. Examples: "{0:MMM yyyy}" shows "Jan 2023", "{0:F2}" shows "123.45". The placeholder "{0}" represents the category value from your data. Essential for making axis labels user-friendly and properly formatted.
Mirror
Flips the position of axis labels to the opposite side of the axis line. When true, labels normally on the left appear on the right, and vice versa. Useful for creating dual-axis layouts or alternative chart arrangements. Helps avoid label overlap when using multiple axes or complex chart configurations. Default false keeps labels in their standard positions.
Position
Determines where category labels appear relative to the axis line and chart area. OnAxis positions labels directly next to the axis line for standard presentation. End places labels at the end of the crossing axis for alternative layouts. Start positions labels at the start of the crossing axis for custom arrangements. Use with axis crossing configurations to achieve desired label positioning in complex chart layouts.
Declaration
[Parameter]
public ChartAxisLabelsPosition? Position { get; set; }
Property Value
Skip
Controls how many category labels to skip from the beginning of the axis. Use to reduce label density when categories are too crowded for readability. Examples: 0 shows all labels, 1 skips every other label, 2 skips two then shows one. Combine with Step for advanced label display patterns. Essential for time-series data with many data points where showing every label would overlap.
Step
Controls the interval for rendering labels - shows every nth label for better spacing. Examples: 1 shows every label, 2 shows every second label, 5 shows every fifth label. Use with large datasets to prevent label overcrowding and improve readability. Different from Skip - this creates regular intervals rather than skipping from the start. Essential for charts with many categories where full label display would be illegible.
Template
Defines a custom template for rendering category axis labels with dynamic content. Available fields: "value" (category value), "dataItem" (source data object), "format" (default format), "culture" (localization). Examples: "<strong>#= value #</strong>" for bold labels, conditional formatting based on dataItem properties. Use Kendo template syntax with "#= expression #" for data binding. Enables complex label customization beyond simple formatting for rich data presentation.
Declaration
[Parameter]
public string Template { get; set; }
Property Value
Visible
Controls whether category axis labels appear in the chart visualization. Set to false to hide labels when categories are self-explanatory or space is limited. Useful for clean, minimalist chart designs or when using custom overlays for category identification. Hidden labels free up space for larger chart plotting area. Default true ensures proper category identification for data interpretation.
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
Overrides
OnAfterRender(bool)
Declaration
protected override void OnAfterRender(bool firstRender)
Parameters
firstRender
Overrides
OnInitialized()
Declaration
protected override void OnInitialized()
Overrides
OnParametersSet()
Declaration
protected override void OnParametersSet()
Overrides
Serialize()
Declaration
public Dictionary<string, object> Serialize()
Returns