ClassChartLegendLabels
Configures the text styling and content for legend labels in ChartLegend. Use this component to customize how series names and information are displayed in the legend, including text color, font styling, custom templates, and spacing. Legend labels provide essential textual identification that helps users understand what each visual element represents in the chart. Children: ChartLegendLabelsMargin, ChartLegendLabelsPadding.
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Syntax:
public class ChartLegendLabels : DataVizChildComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseDataVizChildComponentChartLegendLabels
Implements:
Inherited Members
Constructors
ChartLegendLabels()
Declaration
public ChartLegendLabels()
Properties
ChildContent
Declaration
[Parameter]
public RenderFragment ChildContent { get; set; }
Property Value
Color
Sets the text color for legend labels. Accepts any valid CSS color including hex codes (#333333), RGB values (rgb(51,51,51)), named colors (darkgray), or HSL values. Choose colors that provide good contrast with the legend background for optimal readability and accessibility in different viewing conditions and themes.
Font
Defines the font styling for legend labels using CSS font notation. Specify properties like size, weight, and family in a single string, for example: "14px Arial", "bold 16px 'Times New Roman'", or "italic 12px sans-serif". Proper font styling ensures legend text is readable and matches your application's typography standards.
Template
Defines a custom template for rendering legend labels with dynamic content. Use placeholders like {text} for series names, {series} for series data, {value} for point values (donut/pie charts), or {percentage} for percentage values (donut/pie/100% stacked charts). Templates enable rich legend content with series-specific information, formatting, and custom styling.
Declaration
[Parameter]
public string Template { get; set; }
Property Value
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