[]
Iterable<ISparklineGroup>An ISparklineGroups object is associated with an IRange and provides access to the sparkline groups in that range. Use this interface to add new sparkline groups, retrieve existing groups, clear sparklines, group selected sparklines, and iterate through the collection.
Object[][] data = new Object[][] {
{1, 2, 3},
{4, 5, 6},
{7, 8, 9},
{10, 11, 12}
};
worksheet.getRange("A1:C4").setValue(data);
ISparklineGroups sparklineGroups = worksheet.getRange("D1:D4").getSparklineGroups();
sparklineGroups.add(SparkType.Line, "A1:C4");
ISparklineGroup sparklineGroup = sparklineGroups.get(0);
ISparklineGroup object.voidclear()voidget(int index) ISparklineGroup object from a collection.intgetCount()IRange object.voidgroup()voidvoidungroup()forEach, iterator, spliteratorIRange object.Use this method to determine how many sparkline groups are contained in the range before accessing individual groups.
IRange range = worksheet.getRange("A1:A3");
worksheet.getRange("B1:B3").setValue(new Object[] {1, 3, 2});
range.getSparklineGroups().add(SparkType.Line, "B1:B3");
int count = range.getSparklineGroups().getCount();
ISparklineGroup object from a collection.Use this method to retrieve an existing sparkline group by its position in the current ISparklineGroups collection.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{1, 2, 3},
{4, 5, 6},
{7, 8, 9},
{10, 11, 12}
});
worksheet.getRange("D1:D4").getSparklineGroups().add(SparkType.Line, "A1:C4");
ISparklineGroup sparklineGroup = worksheet.getRange("D1:D4").getSparklineGroups().get(0);
index - Specifies the position of an element in the collection.ISparklineGroup object at the specified position in the collection.ISparklineGroup object.Use this method to create sparklines in the current ISparklineGroups collection from the specified source data range.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{1, 2, 3},
{4, 5, 6},
{7, 8, 9},
{10, 11, 12}
});
ISparklineGroup sparklineGroup = worksheet.getRange("D1:D4").getSparklineGroups().add(SparkType.Line, "A1:C4");
type - The type of sparkline.sourceData - The range reference string to use as the source data for the sparkline group.ISparklineGroup object.Removes the sparkline objects from the cells in the associated range without clearing the underlying worksheet data. To remove entire sparkline groups, use clearGroups() instead.
Object[][] data = new Object[][] {
{1, 2, 3},
{4, 5, 6}
};
worksheet.getRange("A1:C2").setValue(data);
worksheet.getRange("D1:D2").getSparklineGroups().add(SparkType.Line, "A1:C2");
worksheet.getRange("D1").getSparklineGroups().clear();
Removes the sparkline groups associated with the selected cells. Unlike clear(), this method removes entire sparkline groups rather than only clearing individual sparkline objects from the selected cells.
worksheet.getRange("A1:B2").setValue(new Object[][] {
{1, 2},
{3, 4}
});
worksheet.getRange("D1:D2").getSparklineGroups().add(SparkType.Line, "A1:B2");
worksheet.getRange("D1").getSparklineGroups().clearGroups();
Use this method to combine existing sparklines in the associated range into a sparkline group so they share the same group settings.
IRange range = worksheet.getRange("A1:A3");
worksheet.getRange("B1:B3").setValue(new Object[] {1, 3, 2});
range.getSparklineGroups().add(SparkType.Line, "B1:B3");
worksheet.getRange("D1:D3").setValue(new Object[] {2, 4, 1});
worksheet.getRange("E1:E3").getSparklineGroups().add(SparkType.Line, "D1:D3");
worksheet.getRange("A1:E3").getSparklineGroups().group();
The grouped sparklines are based on the sparkline at the specified location. If Location is null, the group is based on the first sparkline in the collection.
Object[][] data = new Object[][] {
{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}
};
worksheet.getRange("A1:C4").setValue(data);
worksheet.getRange("D1:D4").getSparklineGroups().add(SparkType.Line, "A1:C4");
worksheet.getRange("F1:H4").setValue(data);
worksheet.getRange("J1:J4").getSparklineGroups().add(SparkType.Column, "F1:H4");
worksheet.getRange("A1:J4").getSparklineGroups().group(worksheet.getRange("J2"));
Location - The range that specifies which sparkline the new group is based on. If null, the group is based on the first sparkline in the collection.Use this method on the ISparklineGroups collection associated with the sparkline cells to remove the current grouping of those sparklines.
IRange range = worksheet.getRange("A1:A3");
worksheet.getRange("B1:B3").setValue(new Object[] {1, 3, 2});
range.getSparklineGroups().add(SparkType.Line, "B1:B3");
range.getSparklineGroups().ungroup();