[]
        
(Showing Draft Content)

IColorScaleCriteria

Interface IColorScaleCriteria


public interface IColorScaleCriteria
Represents a collection of IColorScaleCriterion objects that define all criteria for a color scale conditional format.

Each criterion specifies a threshold used by the color scale, such as the minimum, midpoint, or maximum value.


 worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {20}, {30}, {40}, {50}});
 IColorScale colorScale = worksheet.getRange("A1:A5").getFormatConditions()
         .addColorScale(ColorScaleType.ThreeColorScale);
 IColorScaleCriteria criteria = colorScale.getColorScaleCriteria();
 IColorScaleCriterion criterion = criteria.get(1);
 
  • Method Summary

    Modifier and Type
    Method
    Description
    get(int index)
    Returns a single IColorScaleCriterion object from the ColorScaleCriteria collection.
    int
    Returns an integer value that specifies the number of criteria for a color scale conditional format rule.
  • Method Details

    • getCount

      int getCount()
      Returns an integer value that specifies the number of criteria for a color scale conditional format rule.

      The returned value corresponds to the number of IColorScaleCriterion objects in this collection.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {
           {10}, {20}, {30}, {40}, {50}
       });
       IColorScale colorScale = worksheet.getRange("A1:A5").getFormatConditions()
           .addColorScale(ColorScaleType.ThreeColorScale);
       int count = colorScale.getColorScaleCriteria().getCount();
       
      Returns:
      The number of criteria in the color scale conditional format rule.
    • get

      IColorScaleCriterion get(int index)
      Returns a single IColorScaleCriterion object from the ColorScaleCriteria collection.

      Each criterion represents one threshold in a color scale conditional format, such as the minimum, midpoint, or maximum value.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {{1}, {2}, {3}, {4}, {5}});
       IColorScale colorScale = worksheet.getRange("A1:A5").getFormatConditions()
               .addColorScale(ColorScaleType.TwoColorScale);
       IColorScaleCriterion criterion = colorScale.getColorScaleCriteria().get(0);
       criterion.setType(ConditionValueTypes.Number);
       
      Parameters:
      index - The index of the criterion to return.
      Returns:
      The specified IColorScaleCriterion object.