Click or drag to resize

IChartTrendLine DataLabel Property

Returns data label. Read only.
Examples
The following code illustrates how to enable and set IChartTextArea text for IChartTrendLine object:
<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 Get chart serie</para><para>Chart chart = worksheet.Charts.Add(ExcelChartType.ColumnClustered);</para><para>chart.DataRange = worksheet.Range["A1:C3"];</para><para>IChartSerie serie = chart.Series[0];</para><para>//Get chart trendlines collection and Add trendline</para><para>IChartTrendLines trendLines = serie.TrendLines;</para><para>IChartTrendLine trendline = trendLines.Add();</para><para>//Enable trendline data label by DisplayRSquared</para><para>trendline.DisplayRSquared = true;</para><para>//Set data label text</para><para>trendline.DataLabel.Text = "y=10*x";</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
IChartDataLabels DataLabel { get; }

Property Value

Type: IChartDataLabels
See Also