menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChartLegendMargin - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChartLegendMargin

    Provides options to customize the margins of a chart legend.

    Inheritance
    System.Object
    ChartSubComponent
    ChartDefaultMargin
    ChartLegendMargin
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChartLegendMargin : ChartDefaultMargin, ISubcomponentTracker

    Constructors

    ChartLegendMargin()

    Declaration
    public ChartLegendMargin()

    Properties

    Bottom

    Gets or sets the bottom margin for the legend.

    Declaration
    public override double Bottom { get; set; }
    Property Value
    Type Description
    System.Double

    The double value representing the bottom margin for the legend. The default value is 0.

    Overrides
    ChartDefaultMargin.Bottom
    Remarks

    Adjust this property to provide space below the chart legend.

    Examples
    // This example demonstrates how to customize the chart's surrounding bottom side of the legend space.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@MedalDetails" Name="Gold" XName="Country" YName="Gold" />
        </ChartSeriesCollection>
        <ChartLegendSettings Visible="true">
            <ChartLegendBorder Color="blue" Width="2" />
            <ChartLegendMargin Bottom="30" />
        </ChartLegendSettings>
    </SfChart>

    Left

    Gets or sets the left margin for the legend.

    Declaration
    public override double Left { get; set; }
    Property Value
    Type Description
    System.Double

    The double value representing the left margin for the legend. The default value is 0.

    Overrides
    ChartDefaultMargin.Left
    Remarks

    Adjust this property to provide space on the left side of the chart legend.

    Examples
    // This example demonstrates how to customize the chart's surrounding left side of the legend space.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@MedalDetails" Name="Gold" XName="Country" YName="Gold" />
        </ChartSeriesCollection>
        <ChartLegendSettings Visible="true">
            <ChartLegendBorder Color="blue" Width="2" />
            <ChartLegendMargin Left="30" />
        </ChartLegendSettings>
    </SfChart>

    Right

    Gets or sets the right margin for the legend.

    Declaration
    public override double Right { get; set; }
    Property Value
    Type Description
    System.Double

    The double value representing the right margin for the legend. The default value is 0.

    Overrides
    ChartDefaultMargin.Right
    Remarks

    Modify this property to provide space on the right side of the chart legend.

    Examples
    // This example demonstrates how to customize the chart's surrounding right side of the legend space.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@MedalDetails" Name="Gold" XName="Country" YName="Gold" />
        </ChartSeriesCollection>
        <ChartLegendSettings Visible="true">
            <ChartLegendBorder Color="blue" Width="2" />
            <ChartLegendMargin Right="30" />
        </ChartLegendSettings>
    </SfChart>

    Top

    Gets or sets the top margin for the legend.

    Declaration
    public override double Top { get; set; }
    Property Value
    Type Description
    System.Double

    The double value representing the top margin for the legend. The default value is 0.

    Overrides
    ChartDefaultMargin.Top
    Remarks

    Use this property to define space above the chart legend.

    Examples
    // This example demonstrates how to customize the chart's surrounding top side of the legend space.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@MedalDetails" Name="Gold" XName="Country" YName="Gold" />
        </ChartSeriesCollection>
        <ChartLegendSettings Visible="true">
            <ChartLegendBorder Color="blue" Width="2" />
            <ChartLegendMargin Top="30" />
        </ChartLegendSettings>
    </SfChart>
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved