Click or drag to resize

IChartLegend LegendEntries Property

Represents legend entries collection. Read only.
Examples
The following code illustrates use of LegendEntries property:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create chart and set range</para><para>IChart chart = worksheet.Charts.Add();</para><para>chart.DataRange = worksheet.Range["B2:C6"];</para><para>//Set chart type</para><para>chart.ChartType = ExcelChartType.Cone3DClustered;</para><para>//Get the count of legend entries</para><para>int legendEntriesCount = chart.Legend.LegendEntries.Count;</para><para>if(legendEntriesCount != 0){ //Your code here }</para><para>//Save to file</para><para>workbook.SaveToFile("Chart.xlsx");</para>

Namespace: Spire.Xls.Core
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
IChartLegendEntries LegendEntries { get; }

Property Value

Type: IChartLegendEntries
See Also