Class
ChartLegendMargin

Controls the external spacing around the entire chart legend in ChartLegend. Use this component to add space between the legend and surrounding chart elements like plot areas, axes, titles, or container edges. Proper margins ensure the legend doesn't overlap with other chart components and maintains clean, professional chart layouts with adequate breathing room.

Definition

Constructors

ChartLegendMargin()

Declaration

cs-api-definition
public ChartLegendMargin()

Properties

Bottom

Sets the bottom margin space below the entire chart legend in pixels. Use this to add spacing between the legend and chart elements positioned below it, such as the chart area, axes, or page content. Common values range from 0-20 pixels depending on overall chart layout and design requirements.

Declaration

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

Property Value

double?

ChildContent

Declaration

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

Property Value

RenderFragment

Left

Sets the left margin space to the left of the entire chart legend in pixels. Creates spacing between the legend and chart elements like the plot area, axes, or container edges. Typical values are 0-15 pixels for standard layouts to ensure proper legend positioning and visual separation.

Declaration

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

Property Value

double?

Right

Sets the right margin space to the right of the entire chart legend in pixels. Use this to create separation between the legend and chart elements positioned to its right, such as the plot area, axes, or container edges. Standard values range from 0-15 pixels for optimal layout balance.

Declaration

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

Property Value

double?

Top

Sets the top margin space above the entire chart legend in pixels. Creates spacing between the legend and chart elements positioned above it, such as chart titles, axes, or other chart components. Common values are 0-20 pixels for proper visual hierarchy and professional appearance.

Declaration

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

Property Value

double?

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>