Class TrendlineCollection
Namespace: Aspose.Cells.Charts
Assembly: Aspose.Cells.dll (25.2.0)
Reprezentuje kolekci všech objektů Aspose.Cells.Charts.Trendline pro specifikovanou datovou řadu.
public class TrendlineCollection : CollectionBase<trendline>, IList<trendline>, ICollection<trendline>, IEnumerable<trendline>, ICollection, IEnumerable
Dědění
object ← CollectionBase<trendline> ← TrendlineCollection
Implementuje
IList<trendline>, ICollection<trendline>, IEnumerable<trendline>, ICollection, IEnumerable
Děděné členy
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()
Příklady
//Instanciace objektu Workbook
Workbook workbook = new Workbook();
//Přidání nového listu do objektu Excel
int sheetIndex = workbook.Worksheets.Add();
//Získání reference na nově přidaný list předáním jeho indexu
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);
//Přidání grafu do listu
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;
'Instanciace objektu Workbook
Dim workbook As Workbook = New Workbook()
'Přidání nového listu do objektu Excel
Dim sheetIndex As Int32 = workbook.Worksheets.Add()
'Získání reference na nově přidaný list předáním jeho indexu
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)
'Přidání grafu do listu
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
Vlastnosti
this[int]
Získá objekt Aspose.Cells.Charts.Trendline podle jeho indexu.
public Trendline this[int index] { get; }
Hodnota vlastnosti
Metody
Add(TrendlineType)
Přidá objekt Aspose.Cells.Charts.Trendline do této kolekce se specifikovaným typem.
public int Add(TrendlineType type)
Parametry
type
TrendlineType
Typ trendové čáry.
Vrací
Index objektu Aspose.Cells.Charts.Trendline.
Add(TrendlineType, string)
Přidá objekt Aspose.Cells.Charts.Trendline do této kolekce se specifikovaným typem a názvem.
public int Add(TrendlineType type, string name)
Parametry
type
TrendlineType
Typ trendové čáry.
name
string
Název trendové čáry.
Vrací
Index objektu Aspose.Cells.Charts.Trendline.