Class TrendlineCollection

Class TrendlineCollection

Namespace: Aspose.Cells.Charts
Assembly: Aspose.Cells.dll (25.2.0)

Representa uma coleção de todos os objetos Aspose.Cells.Charts.Trendline para a série de dados especificada.

public class TrendlineCollection : CollectionBase<trendline>, IList<trendline>, ICollection<trendline>, IEnumerable<trendline>, ICollection, IEnumerable

Herança

objectCollectionBase<trendline>TrendlineCollection

Implementa

IList<trendline>, ICollection<trendline>, IEnumerable<trendline>, ICollection, IEnumerable

Membros Herdados

CollectionBase<trendline>.BinarySearch(Trendline), CollectionBase<trendline>.BinarySearch(Trendline, IComparer<trendline>), CollectionBase<trendline>.BinarySearch(int, int, Trendline, IComparer<trendline>), CollectionBase<trendline>.Contains(Trendline), CollectionBase<trendline>.CopyTo(Trendline[]), CollectionBase<trendline>.CopyTo(Trendline[], int), CollectionBase<trendline>.CopyTo(int, Trendline[], int, int), CollectionBase<trendline>.Exists(Predicate<trendline>), CollectionBase<trendline>.Find(Predicate<trendline>), CollectionBase<trendline>.FindAll(Predicate<trendline>), CollectionBase<trendline>.FindIndex(Predicate<trendline>), CollectionBase<trendline>.FindIndex(int, Predicate<trendline>), CollectionBase<trendline>.FindIndex(int, int, Predicate<trendline>), CollectionBase<trendline>.FindLast(Predicate<trendline>), CollectionBase<trendline>.FindLastIndex(Predicate<trendline>), CollectionBase<trendline>.FindLastIndex(int, Predicate<trendline>), CollectionBase<trendline>.FindLastIndex(int, int, Predicate<trendline>), CollectionBase<trendline>.IndexOf(Trendline), CollectionBase<trendline>.IndexOf(Trendline, int), CollectionBase<trendline>.IndexOf(Trendline, int, int), CollectionBase<trendline>.LastIndexOf(Trendline), CollectionBase<trendline>.LastIndexOf(Trendline, int), CollectionBase<trendline>.LastIndexOf(Trendline, int, int), CollectionBase<trendline>.GetEnumerator(), CollectionBase<trendline>.Clear(), CollectionBase<trendline>.RemoveAt(int), CollectionBase<trendline>.OnClearComplete(), CollectionBase<trendline>.OnClear(), CollectionBase<trendline>.Capacity, CollectionBase<trendline>.Count, CollectionBase<trendline>.InnerList, CollectionBase<trendline>.this[int], object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Exemplos

//Instanciando um objeto Workbook
Workbook workbook = new Workbook();
//Adicionando uma nova planilha ao objeto Excel
int sheetIndex = workbook.Worksheets.Add();
//Obtendo a referência da nova planilha adicionada passando seu índice
Worksheet worksheet = workbook.Worksheets[sheetIndex];
worksheet.Cells["A1"].PutValue(50);
worksheet.Cells["A2"].PutValue(100);
worksheet.Cells["A3"].PutValue(150);
worksheet.Cells["A4"].PutValue(200);
worksheet.Cells["B1"].PutValue(60);
worksheet.Cells["B2"].PutValue(32);
worksheet.Cells["B3"].PutValue(50);
worksheet.Cells["B4"].PutValue(40);

//Adicionando um gráfico à planilha
int chartIndex = workbook.Worksheets[0].Charts.Add(ChartType.Column, 3, 3, 15, 10);
Chart chart = workbook.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;
'Instanciando um objeto Workbook
Dim workbook As Workbook = New Workbook()
'Adicionando uma nova planilha ao objeto Excel
Dim sheetIndex As Int32 = workbook.Worksheets.Add()
'Obtendo a referência da nova planilha adicionada passando seu índice
Dim worksheet As Worksheet = workbook.Worksheets(sheetIndex)
worksheet.Cells("A1").PutValue(50)
worksheet.Cells("A2").PutValue(100)
worksheet.Cells("A3").PutValue(150)
worksheet.Cells("A4").PutValue(200)
worksheet.Cells("B1").PutValue(60)
worksheet.Cells("B2").PutValue(32)
worksheet.Cells("B3").PutValue(50)
worksheet.Cells("B4").PutValue(40)

'Adicionando um gráfico à planilha
Dim chartIndex As Integer =  workbook.Worksheets(0).Charts.Add(ChartType.Column,3,3,15,10) 
Dim chart As Chart =  workbook.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

Propriedades

this[int]

Obtém um objeto Aspose.Cells.Charts.Trendline pelo seu índice.

public Trendline this[int index] { get; }

Valor da Propriedade

Trendline

Métodos

Add(TrendlineType)

Adiciona um objeto Aspose.Cells.Charts.Trendline a esta coleção com o tipo especificado.

public int Add(TrendlineType type)

Parâmetros

type TrendlineType

Tipo de Trendline.

Retorna

int

Índice do objeto Aspose.Cells.Charts.Trendline.

Add(TrendlineType, string)

Adiciona um objeto Aspose.Cells.Charts.Trendline a esta coleção com o tipo e nome especificados.

public int Add(TrendlineType type, string name)

Parâmetros

type TrendlineType

Tipo de Trendline.

name string

Nome da Trendline.

Retorna

int

Índice do objeto Aspose.Cells.Charts.Trendline.

 Português