Record Class SparklineStyle

java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.content.SparklineStyle
Record Components:
seriesColor - the line/bar color, or null for the app default
negativeColor - negative-point color (drawn when showNegative)
axisColor - horizontal-axis color
markersColor - line-marker color (drawn when showMarkers)
firstColor - first-point highlight color
lastColor - last-point highlight color
highColor - highest-point highlight color
lowColor - lowest-point highlight color
showMarkers - draw markers on every point (line type)
showHigh - highlight the highest point
showLow - highlight the lowest point
showFirst - highlight the first point
showLast - highlight the last point
showNegative - highlight negative points
minAxisType - vertical-axis minimum scaling mode ("individual", "group", "custom"), or null for the default
maxAxisType - vertical-axis maximum scaling mode, or null for the default
manualMin - fixed axis minimum (used when minAxisType is "custom"), or null
manualMax - fixed axis maximum (used when maxAxisType is "custom"), or null
dateAxisRange - the date range (e.g. "Sheet1!A2:E2") spacing the category axis by date, or null for an evenly-spaced axis

public record SparklineStyle(String seriesColor, String negativeColor, String axisColor, String markersColor, String firstColor, String lastColor, String highColor, String lowColor, boolean showMarkers, boolean showHigh, boolean showLow, boolean showFirst, boolean showLast, boolean showNegative, String minAxisType, String maxAxisType, Double manualMin, Double manualMax, String dateAxisRange) extends Record
The style of a sparkline group — series/point colors, point-highlight flags, and vertical-axis scaling (MS-XLSX x14:sparklineGroup). Colors use ARGB hex ("FF376092") or "theme:N". Build from defaults() with the with… copies. Sheet.setSparklineStyle replaces every field of the group, so start from the group's current SparklineGroup.style() to change one setting:

 sheet.setSparklineStyle(0, SparklineStyle.defaults()
         .withSeriesColor("FF376092")
         .withNegativeColor("FFD00000")
         .withCustomAxis(0, 100));
 
  • Constructor Details

    • SparklineStyle

      public SparklineStyle(String seriesColor, String negativeColor, String axisColor, String markersColor, String firstColor, String lastColor, String highColor, String lowColor, boolean showMarkers, boolean showHigh, boolean showLow, boolean showFirst, boolean showLast, boolean showNegative, String minAxisType, String maxAxisType, Double manualMin, Double manualMax, String dateAxisRange)
      Creates an instance of a SparklineStyle record class.
      Parameters:
      seriesColor - the value for the seriesColor record component
      negativeColor - the value for the negativeColor record component
      axisColor - the value for the axisColor record component
      markersColor - the value for the markersColor record component
      firstColor - the value for the firstColor record component
      lastColor - the value for the lastColor record component
      highColor - the value for the highColor record component
      lowColor - the value for the lowColor record component
      showMarkers - the value for the showMarkers record component
      showHigh - the value for the showHigh record component
      showLow - the value for the showLow record component
      showFirst - the value for the showFirst record component
      showLast - the value for the showLast record component
      showNegative - the value for the showNegative record component
      minAxisType - the value for the minAxisType record component
      maxAxisType - the value for the maxAxisType record component
      manualMin - the value for the manualMin record component
      manualMax - the value for the manualMax record component
      dateAxisRange - the value for the dateAxisRange record component
  • Method Details

    • defaults

      public static SparklineStyle defaults()
      No colors, no point highlights, default axis — the plain default style.
    • withSeriesColor

      public SparklineStyle withSeriesColor(String color)
      A copy with the line or bar color ("FFRRGGBB" or "theme:N"); null uses the default.
    • withNegativeColor

      public SparklineStyle withNegativeColor(String color)
      Sets the negative-point color and turns showNegative on.
    • withAxisColor

      public SparklineStyle withAxisColor(String color)
      A copy with the horizontal-axis color; null uses the default.
    • withMarkersColor

      public SparklineStyle withMarkersColor(String color)
      Sets the marker color and turns showMarkers on.
    • withFirstColor

      public SparklineStyle withFirstColor(String color)
      Sets the first-point color and turns showFirst on.
    • withLastColor

      public SparklineStyle withLastColor(String color)
      Sets the last-point color and turns showLast on.
    • withHighColor

      public SparklineStyle withHighColor(String color)
      Sets the high-point color and turns showHigh on.
    • withLowColor

      public SparklineStyle withLowColor(String color)
      Sets the low-point color and turns showLow on.
    • withShowMarkers

      public SparklineStyle withShowMarkers(boolean show)
      A copy that draws (true) or hides (false) a marker on every point of a line sparkline; the marker color is kept.
    • withCustomAxis

      public SparklineStyle withCustomAxis(double min, double max)
      Fixes the vertical axis to the range [min, max] across every sparkline in the group (both axis types become "custom") — the shared scale used to compare magnitudes point-for-point.
    • withGroupAxis

      public SparklineStyle withGroupAxis()
      Scales the vertical axis to the whole group's data range (both axis types become "group") — a shared auto scale, without fixed bounds.
    • withDateAxis

      public SparklineStyle withDateAxis(String rangeRef)
      Spaces the category axis by the dates in rangeRef (e.g. "Sheet1!A2:E2") instead of treating every point as equal width — Excel's "Date Axis Type" for a sparkline group. Pass null to clear it.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • seriesColor

      public String seriesColor()
      Returns the value of the seriesColor record component.
      Returns:
      the value of the seriesColor record component
    • negativeColor

      public String negativeColor()
      Returns the value of the negativeColor record component.
      Returns:
      the value of the negativeColor record component
    • axisColor

      public String axisColor()
      Returns the value of the axisColor record component.
      Returns:
      the value of the axisColor record component
    • markersColor

      public String markersColor()
      Returns the value of the markersColor record component.
      Returns:
      the value of the markersColor record component
    • firstColor

      public String firstColor()
      Returns the value of the firstColor record component.
      Returns:
      the value of the firstColor record component
    • lastColor

      public String lastColor()
      Returns the value of the lastColor record component.
      Returns:
      the value of the lastColor record component
    • highColor

      public String highColor()
      Returns the value of the highColor record component.
      Returns:
      the value of the highColor record component
    • lowColor

      public String lowColor()
      Returns the value of the lowColor record component.
      Returns:
      the value of the lowColor record component
    • showMarkers

      public boolean showMarkers()
      Returns the value of the showMarkers record component.
      Returns:
      the value of the showMarkers record component
    • showHigh

      public boolean showHigh()
      Returns the value of the showHigh record component.
      Returns:
      the value of the showHigh record component
    • showLow

      public boolean showLow()
      Returns the value of the showLow record component.
      Returns:
      the value of the showLow record component
    • showFirst

      public boolean showFirst()
      Returns the value of the showFirst record component.
      Returns:
      the value of the showFirst record component
    • showLast

      public boolean showLast()
      Returns the value of the showLast record component.
      Returns:
      the value of the showLast record component
    • showNegative

      public boolean showNegative()
      Returns the value of the showNegative record component.
      Returns:
      the value of the showNegative record component
    • minAxisType

      public String minAxisType()
      Returns the value of the minAxisType record component.
      Returns:
      the value of the minAxisType record component
    • maxAxisType

      public String maxAxisType()
      Returns the value of the maxAxisType record component.
      Returns:
      the value of the maxAxisType record component
    • manualMin

      public Double manualMin()
      Returns the value of the manualMin record component.
      Returns:
      the value of the manualMin record component
    • manualMax

      public Double manualMax()
      Returns the value of the manualMax record component.
      Returns:
      the value of the manualMax record component
    • dateAxisRange

      public String dateAxisRange()
      Returns the value of the dateAxisRange record component.
      Returns:
      the value of the dateAxisRange record component