[]
        
(Showing Draft Content)

ISparkHorizontalAxis

Interface ISparkHorizontalAxis


public interface ISparkHorizontalAxis
Represents the settings for the horizontal axes of a group of sparklines.

Use this interface to access horizontal axis settings for a sparkline group, such as the axis color, whether the axis uses date-based values, and whether points are plotted in right-to-left order. Instances are typically obtained from ISparkAxes.getHorizontal().


 worksheet.getRange("A1:C1").setValue(new Object[] {1, 3, 2});
 ISparklineGroup sparklineGroup = worksheet.getRange("D1").getSparklineGroups().add(SparkType.Line, "A1:C1");
 ISparkHorizontalAxis horizontalAxis = sparklineGroup.getAxes().getHorizontal();
 ISparkColor axisColor = horizontalAxis.getAxis();
 horizontalAxis.setRightToLeftPlotOrder(true);
 
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the ISparkColor object that specifies the color and visibility of the horizontal axis of the sparkline.
    boolean
    Gets whether the horizontal axis of the sparkline is based on date values.
    boolean
    Gets whether the points on the horizontal axis are plotted in right-to-left order.
    void
    setRightToLeftPlotOrder(boolean value)
    Sets whether the points on the horizontal axis are plotted in right-to-left order.
  • Method Details

    • getAxis

      ISparkColor getAxis()
      Gets the ISparkColor object that specifies the color and visibility of the horizontal axis of the sparkline.

      Use the returned ISparkColor object to access and modify the horizontal axis color and visibility settings for the sparkline group.

      
       worksheet.getRange("A1:A4").setValue(new Object[][] {{1}, {3}, {2}, {4}});
       ISparklineGroup group = worksheet.getRange("B1").getSparklineGroups().add(SparkType.Line, "A1:A4");
       ISparkHorizontalAxis horizontalAxis = group.getAxes().getHorizontal();
       ISparkColor axisColor = horizontalAxis.getAxis();
       axisColor.getColor().setColor(Color.GetRed());
       axisColor.setVisible(true);
       
      Returns:
      The ISparkColor object that specifies the color and visibility of the horizontal axis of the sparkline.
    • getIsDateAxis

      boolean getIsDateAxis()
      Gets whether the horizontal axis of the sparkline is based on date values.

      Returns true when the sparkline group uses a date range for its horizontal axis.

      
       worksheet.getRange("A1:A4").setValue(new Object[][] {{2}, {5}, {3}, {6}});
       worksheet.getRange("C1:C4").setValue(new Object[][] {{"2024/1/1"}, {"2024/1/3"}, {"2024/1/6"}, {"2024/1/10"}});
       ISparklineGroup group = worksheet.getRange("B1").getSparklineGroups().add(SparkType.Line, "A1:A4");
       group.setDateRange("C1:C4");
       ISparkHorizontalAxis horizontalAxis = group.getAxes().getHorizontal();
       boolean isDateAxis = horizontalAxis.getIsDateAxis();
       
      Returns:
      true if the horizontal axis of the sparkline is based on date values; otherwise, false.
    • getRightToLeftPlotOrder

      boolean getRightToLeftPlotOrder()
      Gets whether the points on the horizontal axis are plotted in right-to-left order.

      Returns true when points on the sparkline horizontal axis are plotted from right to left instead of the default left-to-right order.

      
       worksheet.getRange("A1:A4").setValue(new Object[][] {{1}, {3}, {2}, {4}});
       ISparklineGroup group = worksheet.getRange("B1").getSparklineGroups().add(SparkType.Line, "A1:A4");
       ISparkHorizontalAxis horizontalAxis = group.getAxes().getHorizontal();
       boolean rightToLeft = horizontalAxis.getRightToLeftPlotOrder();
       
      Returns:
      true if the points on the horizontal axis are plotted in right-to-left order; otherwise, false.
    • setRightToLeftPlotOrder

      void setRightToLeftPlotOrder(boolean value)
      Sets whether the points on the horizontal axis are plotted in right-to-left order.

      Set value to true to plot points on the sparkline horizontal axis from right to left instead of the default left-to-right order.

      
       worksheet.getRange("A1:A4").setValue(new Object[][] {{1}, {3}, {2}, {4}});
       ISparklineGroup group = worksheet.getRange("B1").getSparklineGroups().add(SparkType.Line, "A1:A4");
       ISparkHorizontalAxis horizontalAxis = group.getAxes().getHorizontal();
       horizontalAxis.setRightToLeftPlotOrder(true);
       
      Parameters:
      value - true if the points on the horizontal axis are plotted in right-to-left order; otherwise, false.