ChartLegendLabels
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
public ChartLegendLabels()
Methods
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Overrides:
protected override void OnInitialized()
Overrides:
protected override void OnParametersSet()
Overrides:
Properties
[Parameter]
public RenderFragment ChildContent { get; set; }
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.
[Parameter]
public string Color { get; set; }
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.
[Parameter]
public string Font { get; set; }
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.
[Parameter]
[Obsolete("\r\n The syntax with template literals, e.g. '#= dataItem.Value #' is now deprecated and will be removed in the future.\r\n You need to migrate to using the name of a JavaScript function that returns the value, e.g. Template='getTemplateValue'\r\n See https://www.telerik.com/blazor-ui/documentation/components/chart/labels-template-and-format#templates\r\n and https://www.telerik.com/blazor-ui/documentation/troubleshooting/csp#legacy-settings.\r\n ")]
public string Template { get; set; }