alexa
menu

Blazor Toolkit

    Show / Hide Table of Contents

    Class ChartLocation

    Gets or sets the option for customizing the legend location in the SfChart.

    Inheritance
    System.Object
    SfBaseComponent
    ChartSubComponent
    ChartDefaultLocation
    ChartLocation
    Implements
    System.IAsyncDisposable
    Inherited Members
    SfBaseComponent.DisposeAsync()
    Namespace: Syncfusion.Blazor.Toolkit.Charts
    Assembly: Syncfusion.Blazor.Toolkit.dll
    Syntax
    public class ChartLocation : ChartDefaultLocation, IAsyncDisposable, ISubcomponentTracker
    Remarks

    This is only applicable when the Position is set to LegendPosition.Custom.

    Constructors

    ChartLocation()

    Declaration
    public ChartLocation()

    Properties

    X

    Gets or sets the x-coordinate of the legend's location. This is only applicable when the Position is set to LegendPosition.Custom.

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

    A double value representing the x-coordinate of the legend's location, measured in pixels. The default value is 0 pixel.

    Overrides
    ChartDefaultLocation.X
    Remarks

    This property accepts numerical values to precisely control the x-coordinate of the legend's location.

    Examples
    // This example demonstrates how to determine the x location of a legend based on its position in a chart.
    <SfChart>
        <ChartSeries DataSource="@MedalDetails" Name="Gold" XName="Country" YName="Gold" />
        <ChartLegendSettings Visible="true" Position="LegendPosition.Custom">
            <ChartLocation X="30" />
        </ChartLegendSettings>
    </SfChart>

    Y

    Gets or sets the y-coordinate of the legend's location. This is only applicable when the Position is set to LegendPosition.Custom.

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

    A double value representing the y-coordinate of the legend's location, measured in pixels. The default value is 0 pixel.

    Overrides
    ChartDefaultLocation.Y
    Remarks

    This property accepts numerical values to precisely control the y-coordinate of the legend's location.

    Examples
    // This example demonstrates how to determine the y location of a legend based on its position in a chart.
    <SfChart>
        <ChartSeries DataSource="@MedalDetails" Name="Gold" XName="Country" YName="Gold" />
        <ChartLegendSettings Visible="true" Position="LegendPosition.Custom">
            <ChartLocation Y="40" />
        </ChartLegendSettings>
    </SfChart>

    Implements

    System.IAsyncDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved