Package io.keikai.axyra.sheets.content
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 defaultnegativeColor- negative-point color (drawn whenshowNegative)axisColor- horizontal-axis colormarkersColor- line-marker color (drawn whenshowMarkers)firstColor- first-point highlight colorlastColor- last-point highlight colorhighColor- highest-point highlight colorlowColor- lowest-point highlight colorshowMarkers- draw markers on every point (line type)showHigh- highlight the highest pointshowLow- highlight the lowest pointshowFirst- highlight the first pointshowLast- highlight the last pointshowNegative- highlight negative pointsminAxisType- vertical-axis minimum scaling mode ("individual","group","custom"), or null for the defaultmaxAxisType- vertical-axis maximum scaling mode, or null for the defaultmanualMin- fixed axis minimum (used whenminAxisTypeis"custom"), or nullmanualMax- fixed axis maximum (used whenmaxAxisTypeis"custom"), or nulldateAxisRange- 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 Summary
ConstructorsConstructorDescriptionSparklineStyle(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 aSparklineStylerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaxisColorrecord component.Returns the value of thedateAxisRangerecord component.static SparklineStyledefaults()No colors, no point highlights, default axis — the plain default style.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstColorrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thehighColorrecord component.Returns the value of thelastColorrecord component.lowColor()Returns the value of thelowColorrecord component.Returns the value of themanualMaxrecord component.Returns the value of themanualMinrecord component.Returns the value of themarkersColorrecord component.Returns the value of themaxAxisTyperecord component.Returns the value of theminAxisTyperecord component.Returns the value of thenegativeColorrecord component.Returns the value of theseriesColorrecord component.booleanReturns the value of theshowFirstrecord component.booleanshowHigh()Returns the value of theshowHighrecord component.booleanshowLast()Returns the value of theshowLastrecord component.booleanshowLow()Returns the value of theshowLowrecord component.booleanReturns the value of theshowMarkersrecord component.booleanReturns the value of theshowNegativerecord component.final StringtoString()Returns a string representation of this record class.withAxisColor(String color) A copy with the horizontal-axis color;nulluses the default.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.withDateAxis(String rangeRef) Spaces the category axis by the dates inrangeRef(e.g.withFirstColor(String color) Sets the first-point color and turnsshowFirston.Scales the vertical axis to the whole group's data range (both axis types become"group") — a shared auto scale, without fixed bounds.withHighColor(String color) Sets the high-point color and turnsshowHighon.withLastColor(String color) Sets the last-point color and turnsshowLaston.withLowColor(String color) Sets the low-point color and turnsshowLowon.withMarkersColor(String color) Sets the marker color and turnsshowMarkerson.withNegativeColor(String color) Sets the negative-point color and turnsshowNegativeon.withSeriesColor(String color) A copy with the line or bar color ("FFRRGGBB"or"theme:N");nulluses the default.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.
-
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 aSparklineStylerecord class.- Parameters:
seriesColor- the value for theseriesColorrecord componentnegativeColor- the value for thenegativeColorrecord componentaxisColor- the value for theaxisColorrecord componentmarkersColor- the value for themarkersColorrecord componentfirstColor- the value for thefirstColorrecord componentlastColor- the value for thelastColorrecord componenthighColor- the value for thehighColorrecord componentlowColor- the value for thelowColorrecord componentshowMarkers- the value for theshowMarkersrecord componentshowHigh- the value for theshowHighrecord componentshowLow- the value for theshowLowrecord componentshowFirst- the value for theshowFirstrecord componentshowLast- the value for theshowLastrecord componentshowNegative- the value for theshowNegativerecord componentminAxisType- the value for theminAxisTyperecord componentmaxAxisType- the value for themaxAxisTyperecord componentmanualMin- the value for themanualMinrecord componentmanualMax- the value for themanualMaxrecord componentdateAxisRange- the value for thedateAxisRangerecord component
-
-
Method Details
-
defaults
No colors, no point highlights, default axis — the plain default style. -
withSeriesColor
A copy with the line or bar color ("FFRRGGBB"or"theme:N");nulluses the default. -
withNegativeColor
Sets the negative-point color and turnsshowNegativeon. -
withAxisColor
A copy with the horizontal-axis color;nulluses the default. -
withMarkersColor
Sets the marker color and turnsshowMarkerson. -
withFirstColor
Sets the first-point color and turnsshowFirston. -
withLastColor
Sets the last-point color and turnsshowLaston. -
withHighColor
Sets the high-point color and turnsshowHighon. -
withLowColor
Sets the low-point color and turnsshowLowon. -
withShowMarkers
A copy that draws (true) or hides (false) a marker on every point of a line sparkline; the marker color is kept. -
withCustomAxis
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
Scales the vertical axis to the whole group's data range (both axis types become"group") — a shared auto scale, without fixed bounds. -
withDateAxis
Spaces the category axis by the dates inrangeRef(e.g."Sheet1!A2:E2") instead of treating every point as equal width — Excel's "Date Axis Type" for a sparkline group. Passnullto clear it. -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
seriesColor
Returns the value of theseriesColorrecord component.- Returns:
- the value of the
seriesColorrecord component
-
negativeColor
Returns the value of thenegativeColorrecord component.- Returns:
- the value of the
negativeColorrecord component
-
axisColor
Returns the value of theaxisColorrecord component.- Returns:
- the value of the
axisColorrecord component
-
markersColor
Returns the value of themarkersColorrecord component.- Returns:
- the value of the
markersColorrecord component
-
firstColor
Returns the value of thefirstColorrecord component.- Returns:
- the value of the
firstColorrecord component
-
lastColor
Returns the value of thelastColorrecord component.- Returns:
- the value of the
lastColorrecord component
-
highColor
Returns the value of thehighColorrecord component.- Returns:
- the value of the
highColorrecord component
-
lowColor
Returns the value of thelowColorrecord component.- Returns:
- the value of the
lowColorrecord component
-
showMarkers
public boolean showMarkers()Returns the value of theshowMarkersrecord component.- Returns:
- the value of the
showMarkersrecord component
-
showHigh
public boolean showHigh()Returns the value of theshowHighrecord component.- Returns:
- the value of the
showHighrecord component
-
showLow
public boolean showLow()Returns the value of theshowLowrecord component.- Returns:
- the value of the
showLowrecord component
-
showFirst
public boolean showFirst()Returns the value of theshowFirstrecord component.- Returns:
- the value of the
showFirstrecord component
-
showLast
public boolean showLast()Returns the value of theshowLastrecord component.- Returns:
- the value of the
showLastrecord component
-
showNegative
public boolean showNegative()Returns the value of theshowNegativerecord component.- Returns:
- the value of the
showNegativerecord component
-
minAxisType
Returns the value of theminAxisTyperecord component.- Returns:
- the value of the
minAxisTyperecord component
-
maxAxisType
Returns the value of themaxAxisTyperecord component.- Returns:
- the value of the
maxAxisTyperecord component
-
manualMin
Returns the value of themanualMinrecord component.- Returns:
- the value of the
manualMinrecord component
-
manualMax
Returns the value of themanualMaxrecord component.- Returns:
- the value of the
manualMaxrecord component
-
dateAxisRange
Returns the value of thedateAxisRangerecord component.- Returns:
- the value of the
dateAxisRangerecord component
-