[]
Gets the ITrendline object at the specified index in this collection.
Use this indexer to access an existing trendline that belongs to a chart series.
ITrendline this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As ITrendline
| Type | Name | Description |
|---|---|---|
| int | index | The index of the trendline to return. |
| Type | Description |
|---|---|
| ITrendline | The ITrendline object at the specified index. |
worksheet.Range["A1:B4"].Value = new object[,] {
{"Month", "Sales"},
{"Jan", 10},
{"Feb", 12},
{"Mar", 15}
};
IChart chart = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 20, 20, 300, 200).Chart;
chart.SeriesCollection.Add(worksheet.Range["A1:B4"], RowCol.Columns, true, false);
ITrendlines trendlines = chart.SeriesCollection[0].Trendlines;
trendlines.Add();
ITrendline trendline = trendlines[0];