Skip to main content

LegendEntry Interface

A single legend entry in a chart legend.

Namespace: DevExpress.Spreadsheet.Charts

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

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

public interface LegendEntry

The following members return LegendEntry objects:

Remarks

To hide a single legend entry or change its font, add a LegendEntry instance to the Legend.CustomEntries collection at the required LegendEntry.Index and specify the LegendEntry.Hidden and LegendEntry.Font properties.

The example below removes entries from the chart legend.

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"];

// Exclude entries from the legend.
chart.Legend.CustomEntries.Add(2).Hidden = true;
chart.Legend.CustomEntries.Add(3).Hidden = true;
See Also