Aspose::Cells::Charts::IChartPointCollection Class Referenceabstract

Represents a collection that contains all the points in one series. More...

Inherits Object.

Public Member Functions

virtual intrusive_ptr< Aspose::Cells::Systems::Collections::IEnumerator > GetEnumerator ()=0
 Returns an enumerator for the entire IChartPointCollection More...
 
virtual void Clear ()=0
 Remove all setting of the chart points. More...
 
virtual void RemoveAt (Aspose::Cells::Systems::Int32 index)=0
 Removes point at the index of the series.. More...
 
virtual Aspose::Cells::Systems::Int32 GetCount ()=0
 Gets the count of the chart point. More...
 
virtual intrusive_ptr< Aspose::Cells::Charts::IChartPointGetObjectByIndex (Aspose::Cells::Systems::Int32 index)=0
 Gets the IChartPoint element at the specified index in the series. More...
 

Detailed Description

Represents a collection that contains all the points in one series.

[C++]
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
//Obtaining the reference of the first worksheet
intrusive_ptr<IWorksheet> worksheet = workbook->GetIWorksheets()->GetObjectByIndex(0);
//Adding a sample value to "A1" cell
worksheet->GetICells()->GetObjectByIndex(new String("A1"))->PutValue(50);
//Adding a sample value to "A2" cell
worksheet->GetICells()->GetObjectByIndex(new String("A2"))->PutValue(100);
//Adding a sample value to "A3" cell
worksheet->GetICells()->GetObjectByIndex(new String("A3"))->PutValue(150);
//Adding a sample value to "B1" cell
worksheet->GetICells()->GetObjectByIndex(new String("B1"))->PutValue(60);
//Adding a sample value to "A2" cell
worksheet->GetICells()->GetObjectByIndex(new String("B2"))->PutValue(32);
//Adding a sample value to "A3" cell
worksheet->GetICells()->GetObjectByIndex(new String("B3"))->PutValue(50);
//Adding a chart to the worksheet
int chartIndex = worksheet->GetICharts()->Add(ChartType_Column, 5, 0, 25, 10);
//Accessing the instance of the newly added chart
intrusive_ptr<IChart> chart = worksheet->GetICharts()->GetObjectByIndex(chartIndex);
//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
chart->GetNISeries()->Add(new String("A1:B3"), true);
//Show Data Labels
chart->GetNISeries()->GetObjectByIndex(0)->GetIDataLabels()->SetValueShown(true);
for (int i = 0; i < chart->GetNISeries()->GetObjectByIndex(0)->GetIPoints()->GetCount(); i++)
{
//Get Data Point
intrusive_ptr<IChartPoint> point = chart->GetNISeries()->GetObjectByIndex(0)->GetIPoints()->GetObjectByIndex(i);
//Set Pir Explosion
point->SetExplosion (15);
//Set Border Color
point->GetBorderILine()->SetColor(Systems::Drawing::Color::GetRed());
}
//Saving the Excel file
workbook->Save(new String("D:\\test\\ChartPointCollectionTest.xls"));

Member Function Documentation

◆ Clear()

virtual void Aspose::Cells::Charts::IChartPointCollection::Clear ( )
pure virtual

Remove all setting of the chart points.

◆ GetCount()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::Charts::IChartPointCollection::GetCount ( )
pure virtual

Gets the count of the chart point.

◆ GetEnumerator()

virtual intrusive_ptr<Aspose::Cells::Systems::Collections::IEnumerator> Aspose::Cells::Charts::IChartPointCollection::GetEnumerator ( )
pure virtual

Returns an enumerator for the entire IChartPointCollection

Returns

◆ GetObjectByIndex()

virtual intrusive_ptr<Aspose::Cells::Charts::IChartPoint> Aspose::Cells::Charts::IChartPointCollection::GetObjectByIndex ( Aspose::Cells::Systems::Int32  index)
pure virtual

Gets the IChartPoint element at the specified index in the series.

Parameters
indexThe index of chart point in the series.
Returns
The ChartPoint object.

◆ RemoveAt()

virtual void Aspose::Cells::Charts::IChartPointCollection::RemoveAt ( Aspose::Cells::Systems::Int32  index)
pure virtual

Removes point at the index of the series..

Parameters
indexThe index of the point.