[]
        
(Showing Draft Content)

IPoints

Interface IPoints

All Superinterfaces:
Iterable<IPoint>

public interface IPoints extends Iterable<IPoint>
Represents a collection of all IPoint objects in a chart series.

An IPoints instance is typically obtained from ISeries.getPoints(). It provides indexed access to individual points in the series and supports iteration through all points.


 worksheet.getRange("A1:B4").setValue(new Object[][] {
     {"Item", "Sales"},
     {"North", 12},
     {"South", 18},
     {"West", 9}
 });
 IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 230);
 shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
 ISeries series = shape.getChart().getSeriesCollection().get(0);
 IPoints points = series.getPoints();
 IPoint firstPoint = points.get(0);
 
  • Method Summary

    Modifier and Type
    Method
    Description
    get(int index)
    Gets the chart point at the specified index from the collection.
    int
    Gets the number of IPoint objects in the collection.
    Gets the parent series of this points collection.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • getCount

      int getCount()
      Gets the number of IPoint objects in the collection.

      This method returns the number of data points in the parent chart series.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Item", "Sales"},
           {"Jan", 10},
           {"Feb", 20},
           {"Mar", 15}
       });
       IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200);
       shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       ISeries series = shape.getChart().getSeriesCollection().get(0);
       int count = series.getPoints().getCount();
       
      Returns:
      The number of IPoint objects in the collection.
    • getParent

      ISeries getParent()
      Gets the parent series of this points collection.

      Use this method to access the ISeries object that owns the current collection of chart points.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       IPoints points = series.getPoints();
       ISeries parentSeries = points.getParent();
       
      Returns:
      The ISeries object that contains this collection of points.
    • get

      IPoint get(int index)
      Gets the chart point at the specified index from the collection.

      Use this method to access an individual IPoint object in the current chart series.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       IPoint point = series.getPoints().get(0);
       
      Parameters:
      index - The zero-based index of the point to retrieve.
      Returns:
      The IPoint object at the specified index.