Class TrendlineCollection

Class TrendlineCollection

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

Representa una colección de todos los objetos Aspose.Cells.Charts.Trendline para la serie de datos especificada.

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

Herencia

objectCollectionBase<trendline>TrendlineCollection

Implementa

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

Miembros heredados

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()

Ejemplos

//Instanciando un objeto Workbook
Workbook workbook = new Workbook();
//Agregando una nueva hoja de trabajo al objeto Excel
int sheetIndex = workbook.Worksheets.Add();
//Obteniendo la referencia de la hoja de trabajo recién añadida pasando su índice de hoja
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);

//Agregando un gráfico a la hoja de trabajo
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 un objeto Workbook
Dim workbook As Workbook = New Workbook()
'Agregando una nueva hoja de trabajo al objeto Excel
Dim sheetIndex As Int32 = workbook.Worksheets.Add()
'Obteniendo la referencia de la hoja de trabajo recién añadida pasando su índice de hoja
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)

'Agregando un gráfico a la hoja de trabajo
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

Propiedades

this[int]

Obtiene un objeto Aspose.Cells.Charts.Trendline por su índice.

public Trendline this[int index] { get; }

Valor de la propiedad

Trendline

Métodos

Add(TrendlineType)

Agrega un objeto Aspose.Cells.Charts.Trendline a esta colección con el tipo especificado.

public int Add(TrendlineType type)

Parámetros

type TrendlineType

Tipo de línea de tendencia.

Retorna

int

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

Add(TrendlineType, string)

Agrega un objeto Aspose.Cells.Charts.Trendline a esta colección con el tipo y el nombre especificados.

public int Add(TrendlineType type, string name)

Parámetros

type TrendlineType

Tipo de línea de tendencia.

name string

Nombre de la línea de tendencia.

Retorna

int

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

 Español