Aspose::Cells::Charts::ITrendlineCollection Class Referenceabstract

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

Inherits CollectionBase.

Public Member Functions

virtual Aspose::Cells::Systems::Int32 Add (Aspose::Cells::Charts::TrendlineType type)=0
 Adds a
See also
ITrendline

object to this collection with specified type. More...

 
virtual Aspose::Cells::Systems::Int32 Add (Aspose::Cells::Charts::TrendlineType type, intrusive_ptr< Aspose::Cells::Systems::String > name)=0
 Adds a
See also
ITrendline

object to this collection with specified type and name. More...

 
virtual intrusive_ptr< Aspose::Cells::Charts::ITrendlineGetObjectByIndex (Aspose::Cells::Systems::Int32 index)=0
 Gets a
See also
ITrendline

object by its index. More...

 

Detailed Description

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

[C++]
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
Aspose::Cells::Systems::Int32 chartIndex = workbook->GetIWorksheets()->GetObjectByIndex(0)->GetICharts()->Add(ChartType_Column, 3, 3, 15, 10);
intrusive_ptr<IChart> chart = workbook->GetIWorksheets()->GetObjectByIndex(0)->GetICharts()->GetObjectByIndex(chartIndex);
chart->GetNISeries()->Add(new String("A1:a3"), true);
chart->GetNISeries()->GetObjectByIndex(0)->GetITrendLines()->Add(TrendlineType_Linear, new String("MyTrendLine"));
intrusive_ptr<ITrendline> line = chart->GetNISeries()->GetObjectByIndex(0)->GetITrendLines()->GetObjectByIndex(0);
line->SetDisplayEquation(true);
line->SetDisplayRSquared(true);
line->SetColor( Aspose::Cells::Systems::Drawing::Color::GetRed());
<br>[Visual Basic]
Dim chartIndex As Integer = excel.Worksheets(0).Charts.Add(ChartType.Column,3,3,15,10)
Dim chart As Chart = excel.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

Member Function Documentation

◆ Add() [1/2]

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::Charts::ITrendlineCollection::Add ( Aspose::Cells::Charts::TrendlineType  type)
pure virtual

Adds a

See also
ITrendline

object to this collection with specified type.

Parameters
typeTrendline type.
Returns
ITrendline object index.

◆ Add() [2/2]

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::Charts::ITrendlineCollection::Add ( Aspose::Cells::Charts::TrendlineType  type,
intrusive_ptr< Aspose::Cells::Systems::String >  name 
)
pure virtual

Adds a

See also
ITrendline

object to this collection with specified type and name.

Parameters
typeTrendline type.
nameTrendline name.
Returns
ITrendline object index.

◆ GetObjectByIndex()

virtual intrusive_ptr<Aspose::Cells::Charts::ITrendline> Aspose::Cells::Charts::ITrendlineCollection::GetObjectByIndex ( Aspose::Cells::Systems::Int32  index)
pure virtual

Gets a

See also
ITrendline

object by its index.