[]
Specifies the position of the legend on a chart.
Use this enumeration with Position to place the legend above, below, to the left of, or to the right of the chart, or to use a custom legend position.
public enum LegendPosition
Public Enum LegendPosition
worksheet.Range["A1:C3"].Value = new object[,] {
{"Region", "Sales", "Cost"},
{"North", 100, 80},
{"South", 120, 90}
};
IShape shape = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 20, 20, 320, 220);
shape.Chart.SeriesCollection.Add(worksheet.Range["A1:C3"], RowCol.Columns, true, true);
shape.Chart.Legend.Position = LegendPosition.Right;
| Name | Description |
|---|---|
| Bottom | Specifies a position below the chart. |
| Corner | Specifies a position in the upper right-hand corner of the chart border. |
| Custom | Specifies a custom position. |
| Left | Specifies a position to the left of the chart. |
| Right | Specifies a position to the right of the chart. |
| Top | Specifies a position above the chart. |