[]
ISeries objects in a chart.Use this interface to access, add, and create chart series returned by IChart.getSeriesCollection().
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 10},
{"Feb", 20}
});
IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200);
ISeriesCollection seriesCollection = shape.getChart().getSeriesCollection();
seriesCollection.add(worksheet.getRange("A1:B3"));
voidISeriesCollection collection.voidISeriesCollection collection.voidISeriesCollection from the specified range.voidget(int index) ISeries object with the specified name from the collection.intgetCount()ISeries objects in the collection.forEach, iterator, spliteratorUse this method to navigate from an ISeriesCollection object back to its owning IChart.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 10},
{"Feb", 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B3"));
IChart parentChart = chart.getSeriesCollection().getParent();
IChart object that owns this series collection.ISeries objects in the collection.Use this method to determine how many data series are currently contained in the parent chart.
worksheet.getRange("A1:C3").setValue(new Object[][] {
{"Month", "Sales", "Profit"},
{"Jan", 100, 35},
{"Feb", 120, 40}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C3"), RowCol.Columns, true, true);
int count = chart.getSeriesCollection().getCount();
ISeries objects in the collection.ISeriesCollection collection.The library determines whether the values are taken from rows or columns based on the size and orientation of the selected range.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Sales", "Profit"},
{"Jan", 100, 35},
{"Feb", 120, 40},
{"Mar", 140, 50}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
source - The range that provides the source data for the new series. Must not be null.ISeriesCollection collection.Use rowCol to specify whether each series is created from rows or columns in the source range.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Sales", "Profit"},
{"Jan", 100, 35},
{"Feb", 120, 40},
{"Mar", 140, 50}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns);
source - The range that provides the source data for the new series. Must not be null.rowCol - Specifies whether the source data is arranged by RowCol.Rows or RowCol.Columns. Must not be null.ISeriesCollection from the specified range.Use rowCol to indicate whether each series is built from rows or columns in source. Use seriesLabels to indicate whether the first row or column contains series names, and use categoryLabels to indicate whether the first row or column contains category labels.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Sales", "Profit"},
{"Jan", 10, 4},
{"Feb", 12, 5},
{"Mar", 15, 6}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
source - The range that provides the source data for the new series.rowCol - Specifies whether the source data is arranged by RowCol.Rows or RowCol.Columns.seriesLabels - true if the first row or column in source contains series names; otherwise, false.categoryLabels - true if the first row or column in source contains category labels; otherwise, false.Use this method to extend a chart with additional source data after the initial series have already been added. The rowcol parameter determines whether the new values are read by rows or by columns, and categoryLabels specifies whether the first row or column in source contains category labels.
worksheet.getRange("A1:C3").setValue(new Object[][] {
{"Month", "Sales", "Profit"},
{"Jan", 10, 4},
{"Feb", 12, 5}
});
worksheet.getRange("A4:C5").setValue(new Object[][] {
{"Mar", 15, 6},
{"Apr", 18, 7}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 230).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C3"), RowCol.Columns, true, true);
chart.getSeriesCollection().extend(worksheet.getRange("A4:C5"), RowCol.Columns, false);
source - The range that contains the data points to append to the existing series. null is not supported.rowcol - Specifies whether the values in source are arranged by RowCol.Rows or RowCol.Columns.categoryLabels - true if the first row or column in source contains category labels; otherwise, false.Use this method to access an individual chart series after series have been added to the chart.
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 10},
{"Feb", 20},
{"Mar", 15}
});
IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 230);
shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B4"));
ISeries series = shape.getChart().getSeriesCollection().get(0);
index - The zero-based index of the series to retrieve.ISeries at the specified index.ISeries object with the specified name from the collection.Use this method to retrieve an existing chart series by its name.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 100},
{"Feb", 120}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
ISeries series = chart.getSeriesCollection().get(0);
series.setName("Sales");
ISeries salesSeries = chart.getSeriesCollection().get("Sales");
name - The name of the series to retrieve. null is not supported.ISeries object with the specified name.Use the returned ISeries object to configure the newly created chart series.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Q1", 10},
{"Q2", 20},
{"Q3", 15}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
ISeries series = chart.getSeriesCollection().newSeries();
series.setFormula("=SERIES(\"Sales\",,Sheet1!$B$1:$B$3,1)");
ISeries object that represents the new series.