TrendlineCollection

TrendlineCollection class

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

class TrendlineCollection;

Example

const { Workbook, ChartType, TrendlineType, Color } = require("aspose.cells.node");

var excel = new Workbook();
var chartIndex = excel.getWorksheets().get(0).getCharts().add(ChartType.Column, 3, 3, 15, 10);
var chart = excel.getWorksheets().get(0).getCharts().get(chartIndex);
chart.getNSeries().add("A1:a3", true);
chart.getNSeries().get(0).getTrendLines().add(TrendlineType.Linear, "MyTrendLine");
var line = chart.getNSeries().get(0).getTrendLines().get(0);
line.setDisplayEquation(true);
line.setDisplayRSquared(true);
line.setColor(Color.Red);

Methods

MethodDescription
get(number)Gets a Trendline object by its index.
add(TrendlineType)Adds a Trendline object to this collection with specified type.
add(TrendlineType, string)Adds a Trendline object to this collection with specified type and name.
getCount()Gets the number of elements contained in.
isNull()Checks whether the implementation object is null.

get(number)

Gets a Trendline object by its index.

get(index: number) : Trendline;

Parameters:

ParameterTypeDescription
indexnumber

Returns

Trendline

add(TrendlineType)

Adds a Trendline object to this collection with specified type.

add(type: TrendlineType) : number;

Parameters:

ParameterTypeDescription
typeTrendlineTypeTrendline type.

Returns

Trendline object index.

add(TrendlineType, string)

Adds a Trendline object to this collection with specified type and name.

add(type: TrendlineType, name: string) : number;

Parameters:

ParameterTypeDescription
typeTrendlineTypeTrendline type.
namestringTrendline name.

Returns

Trendline object index.

getCount()

Gets the number of elements contained in.

getCount() : number;

isNull()

Checks whether the implementation object is null.

isNull() : boolean;