[]
        
(Showing Draft Content)

ISparklineGroup

Interface ISparklineGroup

All Superinterfaces:
Iterable<ISparkline>

public interface ISparklineGroup extends Iterable<ISparkline>
Represents a group of sparklines.

An ISparklineGroup contains the sparklines associated with a location range and provides access to shared group settings such as axes, display options, source data, and sparkline type.


 worksheet.getRange("A1:C3").setValue(new Object[][] {
     {1, 3, 2},
     {2, 4, 1},
     {3, 2, 5}
 });
 ISparklineGroup group = worksheet.getRange("D1:D3").getSparklineGroups().add(SparkType.Line, "A1:C3");
 
  • Method Details

    • get

      ISparkline get(int index)
      Gets the ISparkline object at the specified index in the sparkline group.

      Use this method to access an individual sparkline contained in the group.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       ISparkline sparkline = group.get(0);
       
      Parameters:
      index - Index value of the sparkline.
      Returns:
      The ISparkline object at the specified index.
      Throws:
      IndexOutOfBoundsException - if index is less than 0 or greater than or equal to getCount().
    • getAxes

      ISparkAxes getAxes()
      Gets the associated ISparkAxes.

      Use the returned ISparkAxes object to access the horizontal and vertical axis settings for this sparkline group.

      
       worksheet.getRange("A1:C1").setValue(new Object[][] {{10, 15, 8}});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       ISparkAxes axes = group.getAxes();
       ISparkHorizontalAxis horizontalAxis = axes.getHorizontal();
       
      Returns:
      The associated ISparkAxes object.
    • getCount

      int getCount()
      Gets the number of sparklines in the sparkline group.

      Use this method to determine how many individual sparklines are contained in the group.

      
       worksheet.getRange("A1:C3").setValue(new Object[][] {
           {1, 3, 2},
           {4, 6, 5},
           {7, 9, 8}
       });
       ISparklineGroup group = worksheet.getRange("D1:D3").getSparklineGroups().add(SparkType.Line, "A1:C3");
       int count = group.getCount();
       
      Returns:
      The number of sparklines in the sparkline group.
    • getDateRange

      String getDateRange()
      Gets the date range for the sparkline group.

      The date range specifies the cells that provide date-axis values for the sparkline group.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       worksheet.getRange("A2:C2").setValue(new Object[] {
           new GregorianCalendar(2011, 11, 16),
           new GregorianCalendar(2011, 11, 17),
           new GregorianCalendar(2011, 11, 18)
       });
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       group.setDateRange("A2:C2");
       String dateRange = group.getDateRange();
       
      Returns:
      The date range reference string for the sparkline group.
    • setDateRange

      void setDateRange(String value)
      Sets the date range for the sparkline group.

      The date range specifies the cells that provide date-axis values for the sparkline group.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       worksheet.getRange("A2:C2").setValue(new Object[] {
           new GregorianCalendar(2011, 11, 16),
           new GregorianCalendar(2011, 11, 17),
           new GregorianCalendar(2011, 11, 18)
       });
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       group.setDateRange("A2:C2");
       
      Parameters:
      value - The date range reference string for the sparkline group.
    • getDisplayBlanksAs

      DisplayBlanksAs getDisplayBlanksAs()
      Gets the way that blank cells are plotted in the sparkline group.

      Use this method to determine how blank values in the sparkline source data are displayed for the sparkline group.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, null, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       group.setDisplayBlanksAs(DisplayBlanksAs.Zero);
       DisplayBlanksAs blanksAs = group.getDisplayBlanksAs();
       
      Returns:
      The DisplayBlanksAs value that specifies how blank cells are plotted in the sparkline group.
    • setDisplayBlanksAs

      void setDisplayBlanksAs(DisplayBlanksAs value)
      Sets the way that blank cells are plotted in the sparkline group.

      Use this method to control how blank values in the sparkline source data are displayed, such as plotting them as gaps, zero values, or interpolated points according to the specified DisplayBlanksAs setting.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, null, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       group.setDisplayBlanksAs(DisplayBlanksAs.Zero);
       
      Parameters:
      value - The DisplayBlanksAs value that specifies how blank cells are plotted.
    • getDisplayHidden

      boolean getDisplayHidden()
      Gets whether hidden cells are plotted in the sparkline group.
      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       group.setDisplayHidden(true);
       boolean displayHidden = group.getDisplayHidden();
       
      Returns:
      true if hidden cells are plotted in the sparkline group; otherwise, false.
    • setDisplayHidden

      void setDisplayHidden(boolean value)
      Sets whether hidden cells are plotted in the sparkline group.
      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       group.setDisplayHidden(true);
       
      Parameters:
      value - true if hidden cells are plotted in the sparkline group; otherwise, false.
    • getLineWeight

      double getLineWeight()
      Gets the line width of the sparklines in the sparkline group.
      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       group.setLineWeight(2.5);
       double lineWeight = group.getLineWeight();
       
      Returns:
      The line width of the sparklines in the sparkline group.
    • setLineWeight

      void setLineWeight(double value)
      Sets the line width of the sparklines in the sparkline group.
      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       group.setLineWeight(2.5);
       
      Parameters:
      value - The line width of the sparklines in the sparkline group.
    • getLocation

      IRange getLocation()
      Gets the IRange object that represents the location of the sparkline group.

      The returned range identifies the cells where the sparklines in this group are displayed.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       IRange location = group.getLocation();
       
      Returns:
      The IRange object that represents the location of the sparkline group.
    • setLocation

      void setLocation(IRange value)
      Sets the IRange object that represents the location of the sparkline group.

      Use this method to move the sparklines in the group to another display range.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       group.setLocation(worksheet.getRange("E1"));
       
      Parameters:
      value - The IRange object that represents the location of the sparkline group.
    • getPlotBy

      SparklineRowCol getPlotBy()
      Gets how to plot the sparkline when the data on which it is based is in a square-shaped range.

      The returned SparklineRowCol value indicates whether the source data is plotted by rows, by columns, or is not treated as a square-shaped range.

      
       worksheet.getRange("A1:C3").setValue(new Object[][] {
           {1, 3, 2},
           {2, 4, 1},
           {3, 2, 5}
       });
       ISparklineGroup group = worksheet.getRange("D1:D3").getSparklineGroups().add(SparkType.Line, "A1:C3");
       group.setPlotBy(SparklineRowCol.RowsSquare);
       SparklineRowCol plotBy = group.getPlotBy();
       
      Returns:
      The SparklineRowCol value that specifies how the sparkline is plotted when its source data is in a square-shaped range.
    • setPlotBy

      void setPlotBy(SparklineRowCol value)
      Sets how to plot the sparkline when the data on which it is based is in a square-shaped range.

      Use SparklineRowCol to specify whether the source data is plotted by rows, by columns, or not treated as a square-shaped range.

      
       worksheet.getRange("A1:C3").setValue(new Object[][] {
           {1, 3, 2},
           {2, 4, 1},
           {3, 2, 5}
       });
       ISparklineGroup group = worksheet.getRange("D1:D3").getSparklineGroups().add(SparkType.Line, "A1:C3");
       group.setPlotBy(SparklineRowCol.RowsSquare);
       
      Parameters:
      value - The SparklineRowCol value that specifies how the sparkline is plotted when its source data is in a square-shaped range.
    • getPoints

      ISparkPoints getPoints()
      Gets the point marker settings for the sparkline group.

      Returns an ISparkPoints object that provides access to marker settings such as first point, last point, high point, low point, negative points, and general markers for the sparkline group.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       ISparkPoints points = group.getPoints();
       points.getMarkers().setVisible(true);
       
      Returns:
      The ISparkPoints object that represents the point marker settings for the sparkline group.
    • getSeriesColor

      IFormatColor getSeriesColor()
      Gets the IFormatColor object that represents the main series color for the sparkline group.

      Use the returned object to inspect or modify the color applied to the sparkline series.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       IFormatColor seriesColor = group.getSeriesColor();
       seriesColor.setColor(Color.GetBlue());
       
      Returns:
      The IFormatColor object that represents the main series color for the sparkline group.
    • getSourceData

      String getSourceData()
      Gets the range that contains the source data for the sparkline group.

      The returned value is a range reference string that identifies the cells used to generate the sparklines in the group.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       String sourceData = group.getSourceData();
       
      Returns:
      The range reference string that contains the source data for the sparkline group.
    • setSourceData

      void setSourceData(String value)
      Sets the range that contains the source data for the sparkline group.

      Use this method to set the range reference string that identifies the cells used to generate the sparklines in the group.

      
       worksheet.getRange("A1:D1").setValue(new Object[] {1, 3, 2, 4});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       group.setSourceData("A1:D1");
       
      Parameters:
      value - The range reference string that contains the source data for the sparkline group.
    • getType

      SparkType getType()
      Gets the type of sparkline for the group.

      Use this method to determine whether the group is configured as a line, column, or win/loss style sparkline as defined by SparkType.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       SparkType type = group.getType();
       
      Returns:
      The SparkType of the sparkline group.
    • setType

      void setType(SparkType value)
      Sets the type of sparkline for the group.

      Use this method to change how the sparklines in the group are rendered, such as switching between line and column sparklines.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       group.setType(SparkType.Column);
       
      Parameters:
      value - The sparkline type to apply to the group.
    • delete

      void delete()
      Deletes the sparkline group.

      Use this method to remove the current sparkline group after it has been added to a worksheet range.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       group.delete();
       
    • fromJson

      void fromJson(String json)
      Generates the sparkline group from a JSON string.

      Use this method to restore the sparkline group's settings from JSON that was previously generated by toJson().

      
       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");
       String json = sparklineGroup.toJson();
       sparklineGroup.fromJson(json);
       
      Parameters:
      json - The JSON string representing the sparkline group.
    • toJson

      String toJson()
      Generates a JSON string from the sparkline group.

      Use this method to serialize the current sparkline group definition so that it can be reused with fromJson(String) or stored for later use.

      
       worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
       ISparklineGroup group = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
       String json = group.toJson();
       
      Returns:
      The JSON string representing the sparkline group.