ClassChartYAxisLabels
Configures the value labels displayed along the Y-axis to show numeric or categorical data points. Provides comprehensive control over label appearance, formatting, positioning, and spacing to ensure optimal readability and professional presentation. Use this component to customize how values are displayed on the vertical axis, including number formatting, rotation, and visual styling for clear data interpretation.
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Syntax:
public class ChartYAxisLabels : DataVizChildComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseDataVizChildComponentChartYAxisLabels
Implements:
Inherited Members
Constructors
ChartYAxisLabels()
Declaration
public ChartYAxisLabels()
Properties
Background
Sets the background color behind Y-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 data elements. Consider using semi-transparent or subtle colors that enhance readability without overwhelming the chart's visual hierarchy.
Declaration
[Parameter]
public string Background { get; set; }
Property Value
ChildContent
The content of the ChartYAxisLabels component. Children: ChartYAxisLabelsRotation, ChartYAxisLabelsPadding, ChartYAxisLabelsMargin, ChartYAxisLabelsBorder.
Declaration
[Parameter]
public RenderFragment ChildContent { get; set; }
Property Value
Color
Specifies the text color of Y-axis labels for optimal readability and visual consistency. 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 across different viewing conditions and chart backgrounds.
Font
Defines the font styling for Y-axis labels including size, family, and weight for professional typography. 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 viewing distances. Consider font consistency with your application's design system and ensure labels remain legible for precise value reading.
Format
Specifies the format string for displaying Y-axis label values with proper number formatting and precision. Uses standard .NET format patterns like "N2" for numbers with 2 decimals, "C" for currency, or "P" for percentages. Include one placeholder ("{0}") that represents the axis value to be formatted. Choose formats that match your data type and provide appropriate precision for value interpretation and measurement accuracy.
Mirror
Controls whether Y-axis labels appear on the opposite side of their normal position. When set to true, labels that normally appear on the left side of the axis will be rendered on the right side. Use mirroring to accommodate specific chart layouts, avoid overlapping with other chart elements, or create specialized presentations. This feature is particularly useful for multi-axis charts or when you need to optimize space utilization in complex layouts.
Position
Defines the positioning of Y-axis labels relative to the axis line and chart area. 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 readability, especially in constrained spaces or multi-axis configurations. See ChartAxisLabelsPosition for available positioning options and their optimal use cases.
Declaration
[Parameter]
public ChartAxisLabelsPosition? Position { get; set; }
Property Value
Skip
Specifies how many Y-axis labels to skip at the beginning of the axis for optimized spacing. Use this property to create custom label patterns or align labels with specific value intervals. For example, setting Skip to 2 will start displaying labels from the third position. Useful for managing label density in charts with many data points or when creating specialized measurement scales.
Step
Defines the interval for displaying Y-axis labels by rendering every nth label. Set to 2 to show every second label, 3 to show every third label, and so on. Use this property to reduce label density and prevent overcrowding in charts with extensive value ranges. By default, every label is rendered (step = 1) for maximum detail and value precision reference.
Template
Specifies a custom template for rendering Y-axis labels with dynamic content and formatting. The template receives a "value" field containing the axis value for custom display logic. Use templates to create formatted labels, add units, apply conditional styling, or include additional context. Templates provide complete control over label appearance and content beyond standard formatting options.
Declaration
[Parameter]
public string Template { get; set; }
Property Value
Visible
Controls whether Y-axis labels are displayed on the chart for value identification and measurement reference. Set to true (default) to show labels that help users identify exact values and interpret chart data accurately. Set to false to hide labels for minimalist chart designs or when value identification is provided through other means. Hidden labels can provide more space for the plot area while maintaining grid lines and tick marks for visual reference.
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