Skip to main content

Legend.Position Property

Gets or sets the position of the legend on the chart.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

LegendPosition Position { get; set; }

Property Value

Type Description
LegendPosition

A LegendPosition enumeration member that specifies the position.

Available values:

Name Description
Bottom

Below the chart.

Left

On the left of the chart.

Right

On the right of the chart.

Top

Above the chart.

TopRight

In the upper right corner.

Example

View Example

Worksheet worksheet = workbook.Worksheets["chartTask3"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Create a chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet["B2:F6"]);
chart.TopLeftCell = worksheet.Cells["H2"];
chart.BottomRightCell = worksheet.Cells["N14"];

// Specify the position of the legend.
chart.Legend.Position = LegendPosition.Bottom;

The following code snippets (auto-collected from DevExpress Examples) contain references to the Position property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also