TrendlineCollection Class

Represents a collection of all the Trendline objects for the specified data series.
Inheritance Hierarchy

Namespace:  Aspose.Cells.Charts
Assembly:  Aspose.Cells (in Aspose.Cells.dll) Version: 20.10.0.0 (20.10)
Syntax
public class TrendlineCollection : CollectionBase

The TrendlineCollection type exposes the following members.

Properties
  NameDescription
Public propertyCapacity (Inherited from CollectionBase.)
Public propertyCount (Inherited from CollectionBase.)
Protected propertyInnerList (Inherited from CollectionBase.)
Public propertyItem
Gets a object by its index.
Protected propertyList (Inherited from CollectionBase.)
Methods
  NameDescription
Public methodAdd(TrendlineType)
Adds a object to this collection with specified type.
Public methodAdd(TrendlineType, String)
Adds a object to this collection with specified type and name.
Public methodClear (Inherited from CollectionBase.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetEnumerator (Inherited from CollectionBase.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodOnClear (Inherited from CollectionBase.)
Protected methodOnClearComplete (Inherited from CollectionBase.)
Protected methodOnInsert (Inherited from CollectionBase.)
Protected methodOnInsertComplete (Inherited from CollectionBase.)
Protected methodOnRemove (Inherited from CollectionBase.)
Protected methodOnRemoveComplete (Inherited from CollectionBase.)
Protected methodOnSet (Inherited from CollectionBase.)
Protected methodOnSetComplete (Inherited from CollectionBase.)
Protected methodOnValidate (Inherited from CollectionBase.)
Public methodRemoveAt (Inherited from CollectionBase.)
Public methodToString (Inherited from Object.)
Examples
[C#]
int chartIndex = excel.Worksheets[0].Charts.Add(ChartType.Column, 3, 3, 15, 10);
Chart chart = excel.Worksheets[0].Charts[chartIndex];
chart.NSeries.Add("A1:a3", true);
chart.NSeries[0].TrendLines.Add(TrendlineType.Linear, "MyTrendLine");
Trendline line = chart.NSeries[0].TrendLines[0];
line.DisplayEquation = true;
line.DisplayRSquared = true;
line.Color = Color.Red;

[Visual Basic]
Dim chartIndex As Integer =  excel.Worksheets(0).Charts.Add(ChartType.Column,3,3,15,10) 
Dim chart As Chart =  excel.Worksheets(0).Charts(chartIndex) 
chart.NSeries.Add("A1:a3", True)
chart.NSeries(0).TrendLines.Add(TrendlineType.Linear, "MyTrendLine")
Dim line As Trendline =  chart.NSeries(0).TrendLines(0) 
line.DisplayEquation = True
line.DisplayRSquared = True
line.Color = Color.Red
See Also