[]
Iterable<IChartGroup>IChartGroup objects in a specified IChart. Use this interface to access the chart groups contained in a chart, including charts that contain multiple group types. An IChartGroup represents one or more series plotted with the same format.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 10},
{"Feb", 15}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 10, 10, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B3"));
IChartGroups chartGroups = chart.getChartGroups();
IChartGroup chartGroup = chartGroups.get(0);
get(int index) IChartGroup object at the specified index in the collection.intgetCount()IChart that contains this chart group collection.forEach, iterator, spliteratorThe returned value indicates how many IChartGroup objects are contained in this IChartGroups collection for the chart.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Sales", "Target"},
{"Jan", 100, 120},
{"Feb", 140, 130},
{"Mar", 160, 150}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("B1:C4"));
chart.getSeriesCollection().get(1).setChartType(ChartType.Line);
int count = chart.getChartGroups().getCount();
IChart that contains this chart group collection.Use this method to navigate from an IChartGroups collection back to the chart that owns it.
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"));
IChart parentChart = chart.getChartGroups().getParent();
IChart that owns this collection.IChartGroup object at the specified index in the collection.Use this method to access an individual chart group from the IChartGroups collection returned by IChart.getChartGroups().
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Sales", "Target"},
{"Jan", 10, 12},
{"Feb", 20, 18},
{"Mar", 15, 16}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("B1:C4"));
chart.getSeriesCollection().get(1).setChartType(ChartType.Line);
IChartGroup chartGroup = chart.getChartGroups().get(0);
index - The zero-based index of the chart group to retrieve.IChartGroup object at the specified index.