Class
ChartXAxisLabels

Configures the appearance and behavior of labels displayed along the chart X-axis. Provides comprehensive control over label styling, positioning, formatting, and rotation to ensure optimal readability and professional presentation. Use this component to customize how category names, dates, or numeric values are displayed along the horizontal axis.

Definition

Constructors

ChartXAxisLabels()

Declaration

cs-api-definition
public ChartXAxisLabels()

Properties

Background

Sets the background color behind X-axis labels for enhanced visibility and professional presentation. Accepts any valid CSS color value including hex codes (#FFFFFF), RGB values (rgb(255,255,255)), or color names (white). Use background colors to improve label readability over complex chart backgrounds or when labels overlap with chart elements. Consider using semi-transparent or subtle colors that enhance readability while maintaining the chart's visual hierarchy and category identification.

Declaration

cs-api-definition
[Parameter]
public string Background { get; set; }

Property Value

string

ChildContent

The content of the ChartXAxisLabels component. Children: ChartXAxisLabelsRotation, ChartXAxisLabelsPadding, ChartXAxisLabelsMargin, ChartXAxisLabelsBorder.

Declaration

cs-api-definition
[Parameter]
public RenderFragment ChildContent { get; set; }

Property Value

RenderFragment

Color

Specifies the text color of X-axis labels for optimal readability and visual consistency with chart theming. Accepts any valid CSS color value including hex codes (#333333), RGB values (rgb(51,51,51)), or color names (black). Use colors that provide sufficient contrast against the chart background and complement the overall design theme. Consider accessibility requirements and ensure labels remain readable for category identification and chart navigation across different viewing conditions.

Declaration

cs-api-definition
[Parameter]
public string Color { get; set; }

Property Value

string

Font

Defines the font styling for X-axis labels including size, family, and weight for professional typography and category presentation. Accepts valid CSS font declarations such as "12px Arial", "bold 14px 'Segoe UI'", or "italic 11px sans-serif". Use appropriate font sizes that ensure readability at different chart scales and accommodate varying label lengths. Consider font consistency with your application's design system and ensure labels remain legible for category identification and chart navigation.

Declaration

cs-api-definition
[Parameter]
public string Font { get; set; }

Property Value

string

Format

Specifies the format string for displaying X-axis label values with appropriate formatting for categories, dates, or numeric ranges. Uses standard .NET format patterns like "MM/dd/yyyy" for dates, "N0" for integers, or custom patterns for specialized category presentation. Include one placeholder ("{0}") that represents the category value to be formatted. Choose formats that match your data type and provide clear category identification for improved chart navigation and user understanding.

Declaration

cs-api-definition
[Parameter]
public string Format { get; set; }

Property Value

string

Mirror

Controls whether X-axis labels appear on the opposite side of their normal position for specialized chart layouts. When set to true, labels that normally appear below the axis will be rendered above it, or vice versa. Use mirroring to accommodate specific chart layouts, avoid overlapping with other chart elements, or create unique presentations. This feature is particularly useful for multi-axis charts or when you need to optimize space utilization in complex category arrangements.

Declaration

cs-api-definition
[Parameter]
public bool? Mirror { get; set; }

Property Value

bool?

Position

Defines the positioning of X-axis labels relative to the axis line and chart area for optimal layout and readability. Use this property to control whether labels appear inside the chart area, outside near the axis, or in other strategic positions. Label positioning affects chart layout and category readability, especially in constrained spaces or multi-axis configurations. See ChartAxisLabelsPosition for available positioning options and their optimal use cases for horizontal axis labeling.

Declaration

cs-api-definition
[Parameter]
public ChartAxisLabelsPosition? Position { get; set; }

Property Value

ChartAxisLabelsPosition?

Skip

Specifies how many X-axis labels to skip at the beginning of the axis for optimized spacing and category presentation. Use this property to create custom label patterns or align labels with specific category intervals. For example, setting Skip to 2 will start displaying labels from the third category position. Useful for managing label density in charts with many categories or when creating specialized category groupings and navigation patterns.

Declaration

cs-api-definition
[Parameter]
public double? Skip { get; set; }

Property Value

double?

Step

Defines the interval for displaying X-axis labels by rendering every nth label for optimal category spacing. Set to 2 to show every second label, 3 to show every third label, and so on to prevent overcrowding. Use this property to reduce label density and improve readability in charts with extensive category ranges or long category names. By default, every label is rendered (step = 1) for maximum detail and complete category representation.

Declaration

cs-api-definition
[Parameter]
public double? Step { get; set; }

Property Value

double?

Template

Specifies a custom template for rendering X-axis labels with dynamic content and specialized category formatting. The template receives a "value" field containing the category value for custom display logic and presentation. Use templates to create formatted labels, add icons, apply conditional styling, or include additional category context. Templates provide complete control over label appearance and content beyond standard formatting options for enhanced category presentation.

Declaration

cs-api-definition
[Parameter]
public string Template { get; set; }

Property Value

string

Visible

Controls whether X-axis labels are displayed on the chart for category identification and navigation reference. Set to true (default) to show labels that help users identify categories and navigate chart data effectively. Set to false to hide labels for minimalist chart designs or when category identification is provided through other means. Hidden labels can provide more space for the plot area while maintaining axis structure for data positioning and chart layout.

Declaration

cs-api-definition
[Parameter]
public bool? Visible { get; set; }

Property Value

bool?

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

OnAfterRender(bool)

Declaration

cs-api-definition
protected override void OnAfterRender(bool firstRender)

Parameters

firstRender

bool

Overrides ComponentBase.OnAfterRender(bool)

OnInitialized()

Declaration

cs-api-definition
protected override void OnInitialized()

Overrides DataVizChildComponent.OnInitialized()

OnParametersSet()

Declaration

cs-api-definition
protected override void OnParametersSet()

Overrides ComponentBase.OnParametersSet()

Serialize()

Declaration

cs-api-definition
public Dictionary<string, object> Serialize()

Returns

Dictionary<string, object>