The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

Series.Trendlines Property

Provides access to a collection of trendlines for the series.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v19.2.Core.dll

Declaration

TrendlineCollection Trendlines { get; }
ReadOnly Property Trendlines As TrendlineCollection
TrendlineCollection Trendlines { get; }
ReadOnly Property Trendlines As TrendlineCollection
TrendlineCollection Trendlines { get; }
ReadOnly Property Trendlines As TrendlineCollection

Property Value

Type Description
TrendlineCollection

A TrendlineCollection object that is the collection of all the Trendline objects for the series.

Property Value

Type Description
TrendlineCollection

A TrendlineCollection object that is the collection of all the Trendline objects for the series.

Property Value

Type Description
TrendlineCollection

A TrendlineCollection object that is the collection of all the Trendline objects for the series.

Remarks

The following code uses the TrendlineCollection.Add method to display a trendline of the ChartTrendlineType.Polynomial type.

Worksheet worksheet = workbook.Worksheets["chartTask3"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Create a chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.ColumnStacked);
chart.SelectData(worksheet["C2:F3"], ChartDataDirection.Row);
chart.TopLeftCell = worksheet.Cells["H2"];
chart.BottomRightCell = worksheet.Cells["N14"];

// Show data labels.
chart.Views[0].DataLabels.ShowValue = true;

// Display a polynomial trendline.
chart.Series[0].Trendlines.Add(ChartTrendlineType.Polynomial);

The resulting chart is shown in the following picture.

Trendlines

See Also