[]
        
(Showing Draft Content)

ISparkColor

Interface ISparkColor


public interface ISparkColor
Represents color and visibility settings for a sparkline point marker or horizontal axis.

Use this interface to configure the color and visibility for sparkline point markers, such as positive, negative, first, last, highest, or lowest points, or for the horizontal axis returned by ISparkHorizontalAxis.getAxis(). Its getColor() and setVisible(boolean) members control how the associated marker or horizontal axis is displayed.


 worksheet.getRange("A1:C3").setValue(new Object[][] {
     {1, 3, 2},
     {4, 2, 5},
     {3, 6, 4}
 });
 ISparklineGroup group = worksheet.getRange("D1:D3").getSparklineGroups().add(SparkType.Line, "A1:C3");
 ISparkColor sparkColor = group.getPoints().getMarkers();
 sparkColor.getColor().setColor(Color.GetRed());
 sparkColor.setVisible(true);
 ISparkColor axisColor = group.getAxes().getHorizontal().getAxis();
 axisColor.getColor().setColor(Color.GetRed());
 axisColor.setVisible(true);
 
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets an IFormatColor object that you can use to set the color of the associated sparkline marker or horizontal axis.
    boolean
    Gets whether the associated sparkline marker or horizontal axis is visible.
    void
    setVisible(boolean value)
    Sets whether the associated sparkline marker or horizontal axis is visible.
  • Method Details

    • getColor

      IFormatColor getColor()
      Gets an IFormatColor object that you can use to set the color of the associated sparkline marker or horizontal axis.

      Use the returned object to configure the color for the associated sparkline point marker or horizontal axis.

      
       worksheet.getRange("A1:C4").setValue(new Object[][] {
           {1, 2, 3},
           {4, 5, 6},
           {7, 6, 5},
           {4, 3, 2}
       });
       worksheet.getRange("D1:D4").getSparklineGroups().add(SparkType.Line, "A1:C4");
       ISparklineGroup sparklineGroup = worksheet.getRange("D1").getSparklineGroups().get(0);
       IFormatColor color = sparklineGroup.getPoints().getMarkers().getColor();
       color.setColor(Color.GetRed());
       
      Returns:
      The IFormatColor object used to configure the color of the associated sparkline marker or horizontal axis.
    • getVisible

      boolean getVisible()
      Gets whether the associated sparkline marker or horizontal axis is visible.

      This property indicates whether the corresponding sparkline point marker or horizontal axis is displayed.

      
       worksheet.getRange("A1:C3").setValue(new Object[][] {
           {1, 3, 2},
           {4, 2, 5},
           {3, 6, 4}
       });
       ISparklineGroup group = worksheet.getRange("D1:D3").getSparklineGroups().add(SparkType.Line, "A1:C3");
       group.getPoints().getMarkers().setVisible(true);
       boolean visible = group.getPoints().getMarkers().getVisible();
       
      Returns:
      true if the associated marker or horizontal axis is visible; otherwise, false.
    • setVisible

      void setVisible(boolean value)
      Sets whether the associated sparkline marker or horizontal axis is visible.

      This property indicates whether the corresponding sparkline point marker or horizontal axis is displayed.

      
       worksheet.getRange("A1:C3").setValue(new Object[][] {
           {1, 3, 2},
           {4, 2, 5},
           {3, 6, 4}
       });
       ISparklineGroup group = worksheet.getRange("D1:D3").getSparklineGroups().add(SparkType.Line, "A1:C3");
       group.getPoints().getMarkers().setVisible(true);
       
      Parameters:
      value - true if the associated marker or horizontal axis is visible; otherwise, false.