[]
        
(Showing Draft Content)

ICascadeSparkLine

Interface ICascadeSparkLine


public interface ICascadeSparkLine
Represents a cascade sparkLine.

A cascade sparkline exposes the data and display settings resolved from a CASCADESPARKLINE formula, including point values, labels, point index, bounds, item types, and colors.


 worksheet.getRange("A2:B4").setValue(new Object[][] {
     {"Salary", 3500},
     {"Bonus", 1200},
     {"Expense", -800}
 });
 worksheet.getRange("C2").setFormula("=CASCADESPARKLINE(B2:B4,1,A2:A4,,,\"#8CBF64\",\"#D6604D\",FALSE)");
 ICascadeSparkLine sparkLine = (ICascadeSparkLine) worksheet.getRange("C2").getValue();
 double[] points = sparkLine.getPoints();
 
  • Method Details

    • getPoints

      double[] getPoints()
      Gets the values of the points.

      The returned array contains the numeric values represented by the points in the cascade sparkline.

      
       worksheet.getRange("A2:B4").setValue(new Object[][] {
           {"Salary", 3500},
           {"Bonus", 1200},
           {"Expense", -800}
       });
       worksheet.getRange("C2").setFormula("=CASCADESPARKLINE(B2:B4,1,A2:A4,,,\"#8CBF64\",\"#D6604D\",FALSE)");
       ICascadeSparkLine sparkLine = (ICascadeSparkLine) worksheet.getRange("C2").getValue();
       double[] points = sparkLine.getPoints();
       
      Returns:
      An array that contains the values of the points.
    • getPointIndex

      double getPointIndex()
      Gets the point index of the cascade sparkline.

      Represents the points index. The point index is greater than or equal to 1.

      
       worksheet.getRange("A2:A4").setValue(new Object[] {"Start", "Increase", "End"});
       worksheet.getRange("B2:B4").setValue(new Object[] {100, 50, 150});
       worksheet.getRange("C2").setFormula("=CASCADESPARKLINE(B2:B4,1,A2:A4,,,\"#8CBF64\",\"#D6604D\",FALSE)");
       ICascadeSparkLine sparkLine = (ICascadeSparkLine) worksheet.getRange("C2").getValue();
       double pointIndex = sparkLine.getPointIndex();
       
      Returns:
      The point index of the cascade sparkline.
    • getLabels

      String[] getLabels()
      Gets the labels of the cascade sparkline.

      The returned array contains the labels associated with the sparkline points. The default value is null.

      
       worksheet.getRange("A2:B4").setValue(new Object[][] {
           {"Salary", 3500},
           {"Bonus", 1200},
           {"Expense", -800}
       });
       worksheet.getRange("C2").setFormula("=CASCADESPARKLINE(B2:B4,1,A2:A4,,,\"#8CBF64\",\"#D6604D\",FALSE)");
       ICascadeSparkLine sparkLine = (ICascadeSparkLine) worksheet.getRange("C2").getValue();
       String[] labels = sparkLine.getLabels();
       
      Returns:
      An array that contains the labels of the cascade sparkline, or null if no labels are specified.
    • getMinimum

      Double getMinimum()
      Gets the minimum value of the display area.

      This value defines the lower bound used to display the cascade sparkline. The default value is null.

      
       worksheet.getRange("A2:B4").setValue(new Object[][] {
           {"Salary", 3500},
           {"Bonus", 1200},
           {"Expense", -800}
       });
       worksheet.getRange("C2").setFormula("=CASCADESPARKLINE(B2:B4,1,A2:A4,-1000,,\"#8CBF64\",\"#D6604D\",FALSE)");
       ICascadeSparkLine sparkLine = (ICascadeSparkLine) worksheet.getRange("C2").getValue();
       Double minimum = sparkLine.getMinimum();
       
      Returns:
      A number that represents the minimum value of the display area, or null if no minimum value is specified.
    • getMaximum

      Double getMaximum()
      Gets the maximum value of the display area.

      This value defines the upper bound used to display the cascade sparkline. The default value is null.

      
       worksheet.getRange("A2:B4").setValue(new Object[][] {
           {"Salary", 3500},
           {"Bonus", 1200},
           {"Expense", -800}
       });
       worksheet.getRange("C2").setFormula("=CASCADESPARKLINE(B2:B4,1,A2:A4,,4000,\"#8CBF64\",\"#D6604D\",FALSE)");
       ICascadeSparkLine sparkLine = (ICascadeSparkLine) worksheet.getRange("C2").getValue();
       Double maximum = sparkLine.getMaximum();
       
      Returns:
      A number that represents the maximum value of the display area, or null if no maximum value is specified.
    • getColorPositive

      String getColorPositive()
      Gets the color of the first or last positive sparkline box.

      This color is used for a box whose point value is positive. The default value is "#8CBF64".

      
       worksheet.getRange("A2:B4").setValue(new Object[][] {
           {"Salary", 3500},
           {"Bonus", 1200},
           {"Expense", -800}
       });
       worksheet.getRange("C2").setFormula("=CASCADESPARKLINE(B2:B4,1,A2:A4,,,\"#8CBF64\",\"#D6604D\",FALSE)");
       ICascadeSparkLine sparkLine = (ICascadeSparkLine) worksheet.getRange("C2").getValue();
       String color = sparkLine.getColorPositive();
       
      Returns:
      The color string of the first or last positive sparkline box.
    • getColorNegative

      String getColorNegative()
      Gets the color of the first or last negative sparkline box.

      This color is used for a box whose point value is negative. The default value is "#D6604D".

      
       worksheet.getRange("A2:B4").setValue(new Object[][] {
           {"Salary", 3500},
           {"Expense", -800},
           {"Bonus", 1200}
       });
       worksheet.getRange("C2").setFormula("=CASCADESPARKLINE(B2:B4,2,A2:A4,,,\"#8CBF64\",\"#D6604D\",FALSE)");
       ICascadeSparkLine sparkLine = (ICascadeSparkLine) worksheet.getRange("C2").getValue();
       String color = sparkLine.getColorNegative();
       
      Returns:
      The color string of the first or last negative sparkline box.
    • getVertical

      boolean getVertical()
      Gets whether the cascade sparkline's box direction is vertical or horizontal.

      A value of true indicates that the boxes are displayed vertically, and false indicates that they are displayed horizontally. The default value is false.

      
       worksheet.getRange("A2:A4").setValue(new Object[] {"Start", "Increase", "End"});
       worksheet.getRange("B2:B4").setValue(new Object[] {100, 50, 150});
       worksheet.getRange("C2").setFormula("=CASCADESPARKLINE(B2:B4,1,A2:A4,,,\"#8CBF64\",\"#D6604D\",TRUE)");
       ICascadeSparkLine sparkLine = (ICascadeSparkLine) worksheet.getRange("C2").getValue();
       boolean vertical = sparkLine.getVertical();
       
      Returns:
      true if the sparkline boxes are displayed vertically; otherwise, false.
    • getItemTypes

      String[] getItemTypes()
      Gets all item types.

      The returned item types identify the marker used for each item in the cascade sparkline. The values should be "-", "+", or "=". The default value is null.

      
       worksheet.getRange("A2:B4").setValue(new Object[][] {
           {"Income", 500},
           {"Expense", -200},
           {"Balance", 300}
       });
       worksheet.getRange("D2:D4").setValue(new Object[][] { { "+" }, { "-" }, { "=" } });
       worksheet.getRange("C2").setFormula("=CASCADESPARKLINE(B2:B4,3,A2:A4,,,\"#8CBF64\",\"#D6604D\",FALSE,D2:D4,\"#4F81BD\")");
       ICascadeSparkLine sparkLine = (ICascadeSparkLine) worksheet.getRange("C2").getValue();
       String[] itemTypes = sparkLine.getItemTypes();
       
      Returns:
      An array that contains the item types for the cascade sparkline, or null if no item types are available.
    • getColorTotal

      String getColorTotal()
      Gets the color of the total sparkline box.

      This color represents the color of the last sparkline box when itemTypeRange does not exist, or the color of the resulting sparkline box when itemTypeRange exists. The default value is null.

      
       worksheet.getRange("A2:B4").setValue(new Object[][] {
           {"Income", 500},
           {"Expense", -200},
           {"Balance", 300}
       });
       worksheet.getRange("D2:D4").setValue(new Object[][] { { "+" }, { "-" }, { "=" } });
       worksheet.getRange("C2").setFormula("=CASCADESPARKLINE(B2:B4,3,A2:A4,,,\"#8CBF64\",\"#D6604D\",FALSE,D2:D4,\"#4F81BD\")");
       ICascadeSparkLine sparkLine = (ICascadeSparkLine) worksheet.getRange("C2").getValue();
       String color = sparkLine.getColorTotal();
       
      Returns:
      The color string of the total sparkline box, or null if no total color is specified.