[]
Iterable<ILegendEntry>Use this interface to access individual ILegendEntry objects in a legend, iterate through the entries, and retrieve the legend that owns the collection. This collection is returned by ILegend.getLegendEntries().
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Region", "Sales"},
{"North", 100},
{"South", 200}
});
IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 200, 20, 300, 200);
shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
ILegendEntries legendEntries = shape.getChart().getLegend().getLegendEntries();
ILegendEntry firstEntry = legendEntries.get(0);
forEach, iterator, spliteratorUse this method to determine how many ILegendEntry objects are contained in the legend for a chart.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Name", "Value"},
{"A", 10},
{"B", 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.setSourceData(worksheet.getRange("A1:B3"));
int count = chart.getLegend().getLegendEntries().getCount();
Use this method to access the ILegend object that owns the current ILegendEntries collection.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Name", "Value"},
{"A", 10},
{"B", 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.setSourceData(worksheet.getRange("A1:B3"));
ILegendEntries legendEntries = chart.getLegend().getLegendEntries();
ILegend legend = legendEntries.getParent();
ILegend object that contains this legend entry collection.Use this method to access a single ILegendEntry object from the current legend entry collection.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Name", "Value"},
{"A", 10},
{"B", 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.setSourceData(worksheet.getRange("A1:B3"));
ILegendEntry legendEntry = chart.getLegend().getLegendEntries().get(0);
IFontFormat font = legendEntry.getFont();
index - The zero-based index of the legend entry to retrieve.ILegendEntry object at the specified index.