Class XlsChartLegendEntry
- Namespace
- Spire.Xls.Core.Spreadsheet.Charts
- Assembly
- Spire.XLS.dll
public class XlsChartLegendEntry : XlsObject, IExcelApplication, IDisposable, IChartLegendEntry
- Inheritance
-
XlsChartLegendEntry
- Implements
- Derived
- Inherited Members
Properties
BackgroundMode
Display mode of the background.
public ChartBackgroundMode BackgroundMode { get; set; }
Property Value
Index
Represents index in collection.
public int Index { get; set; }
Property Value
IsDeleted
If true then this entry deleted. otherwise false.
//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chart and set rangeIChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["B2:C6"];//Set chart typechart.ChartType = ExcelChartType.Cone3DClustered;//Create a chartLegendIChartLegend chartLegend = chart.Legend;chartLegend.LegendEntries[0].Delete();//True if the entry is deletedbool isDeletedEntry = chartLegend.LegendEntries[0].IsDeleted;if(isDeletedEntry){ //Your code here }//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool IsDeleted { get; set; }
Property Value
IsFormatted
Indicates whether the legend entry has been formatted.
public bool IsFormatted { get; set; }
Property Value
LegendEntityIndex
Legend-entry index.
public int LegendEntityIndex { get; set; }
Property Value
TextArea
Represents text area.
//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chart and set rangeIChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["B2:C6"];//Set chart typechart.ChartType = ExcelChartType.Cone3DClustered;//Create a chartLegendIChartLegend chartLegend = chart.Legend;chartLegend.LegendEntries[1].TextArea.Color = Color.Blue;chartLegend.LegendEntries[1].TextArea.Size = 10;chartLegend.LegendEntries[1].TextArea.FontName = "Bernard MT Condensed";//Save to fileworkbook.SaveToFile("Chart.xlsx");
public IChartTextArea TextArea { get; }
Property Value
Methods
BeginUpdate()
public void BeginUpdate()
Clear()
public void Clear()
Clone(object, Dictionary<int, int>, Dictionary<string, string>)
public XlsChartLegendEntry Clone(object parent, Dictionary<int, int> dicIndexes, Dictionary<string, string> dicNewSheetNames)
Parameters
parent
objectdicIndexes
Dictionary<int, int>dicNewSheetNames
Dictionary<string, string>
Returns
Delete()
Deletes current legend entry.
//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chart and set rangeIChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["B2:C6"];//Set chart typechart.ChartType = ExcelChartType.Cone3DClustered;//Create a chartLegendIChartLegend chartLegend = chart.Legend;//Delete the first legend entry out of five entireschartLegend.LegendEntries[0].Delete();//Save to fileworkbook.SaveToFile("Chart.xlsx");
public void Delete()
EndUpdate()
public void EndUpdate()