New to Telerik UI for BlazorStart a free 30-day trial

Controls the external spacing around legend labels in ChartLegendLabels. Use this component to add space between legend labels and surrounding elements like markers, borders, or other legend components. Proper margins ensure legend text doesn't appear crowded and maintains good readability in various legend layouts and densities.

Definition

Constructors

C#
public ChartLegendLabelsMargin()

Methods

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

C#
protected override void OnAfterRender(bool firstRender)
Parameters:firstRenderbool

Overrides: ComponentBase.OnAfterRender(bool)

C#
protected override void OnInitialized()

Overrides: DataVizChildComponent.OnInitialized()

C#
protected override void OnParametersSet()

Overrides: ComponentBase.OnParametersSet()

C#
public Dictionary<string, object> Serialize()
Returns:

Dictionary<string, object>

Properties

Sets the bottom margin space below legend labels in pixels. Use this to add spacing between labels and chart elements positioned below them, such as the chart area or other legend elements. Common values range from 0-10 pixels to create proper visual separation without excessive spacing that wastes legend area.

C#
[Parameter]
public double? Bottom { get; set; }
C#
[Parameter]
public RenderFragment ChildContent { get; set; }

Sets the left margin space to the left of legend labels in pixels. Creates spacing between labels and legend markers or borders. Typical values are 2-8 pixels to ensure labels don't appear too close to markers while maintaining efficient use of legend space.

C#
[Parameter]
public double? Left { get; set; }

Sets the right margin space to the right of legend labels in pixels. Use this to create separation between labels and the right edge of the legend or other legend elements. Standard values range from 0-8 pixels depending on legend layout and content density.

C#
[Parameter]
public double? Right { get; set; }

Sets the top margin space above legend labels in pixels. Creates spacing between labels and chart elements positioned above them, such as legend titles or chart elements. Common values are 0-10 pixels for proper visual hierarchy and readability.

C#
[Parameter]
public double? Top { get; set; }