alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class ChartLocation

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

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    ChartSubComponent
    ChartDefaultLocation
    ChartLocation
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnInitializedAsync()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.Dispose(bool)
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChartLocation : ChartDefaultLocation, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    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
    [Parameter]
    public override double X { get; set; }
    Property Value
    Type Description
    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
    [Parameter]
    public override double Y { get; set; }
    Property Value
    Type Description
    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>

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved