menu

Blazor

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

    Show / Hide Table of Contents

    Class ChartLocation

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

    Inheritance
    System.Object
    ChartSubComponent
    ChartDefaultLocation
    ChartLocation
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChartLocation : ChartDefaultLocation, 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>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@MedalDetails" Name="Gold" XName="Country" YName="Gold" />
        </ChartSeriesCollection>
        <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>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@MedalDetails" Name="Gold" XName="Country" YName="Gold" />
        </ChartSeriesCollection>
        <ChartLegendSettings Visible="true" Position="LegendPosition.Custom">
            <ChartLocation Y="40" />
        </ChartLegendSettings>
    </SfChart>
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved