IChartLegend Methods |
The IChartLegend type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() |
Clear |
Clears chart legend.
![]()
The following code illustrates how to use the Clear method for legend of chart:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Clears the legend of chart</para><para>worksheet.Charts[0].Legend.Clear();</para><para>//Save to file</para><para>workbook.SaveToFile("Chart.xlsx");</para>
|
![]() ![]() |
Delete |
Deletes chart legend.
![]()
The following code illustrates how to use the Delete method for legend of chart:
<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>//Clears the legend of chart</para><para>worksheet.Charts[0].Legend.Delete();</para><para>//Save to file</para><para>workbook.SaveToFile("Chart.xlsx");</para>
|