Click or drag to resize

IChartDataLabels HasCategoryName Property

Indicates whether category name is in data labels.
Examples
The following code illustrates how to access the IChartDataLabels and set to shows the categories:
<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>Chart chart = worksheet.Charts.Add();</para><para>chart.DataRange = worksheet.Range["A1:C3"];</para><para>//Set chart type</para><para>chart.ChartType = ExcelChartType.ColumnClustered;</para><para>//Get the chart serie</para><para>IChartSerie serie = chart.Series[0];</para><para>//Get serie data labels</para><para>IChartDataLabels dataLabels = serie.DataPoints.DefaultDataPoint.DataLabels;</para><para>//Set the data label to show the category names</para><para>dataLabels.HasCategoryName = true;</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
bool HasCategoryName { get; set; }

Property Value

Type: Boolean
See Also