Class ChartLocation
Gets or sets the option for customizing the legend location in the SfChart.
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
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
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>