Click or drag to resize

IChartDataLabels Position Property

Represents data labels position.
Examples
The following code illustrates how to access the IChartDataLabels and set to the position for labels:
<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:C2"];</para><para>//Set chart type</para><para>chart.ChartType = ExcelChartType.Pie;</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 leader lines</para><para>dataLabels.HasValue = true;</para><para>dataLabels.Position = DataLabelPositionType.Outside;</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
DataLabelPositionType Position { get; set; }

Property Value

Type: DataLabelPositionType
See Also