- java.lang.Object
-
- eu.ess.xaos.ui.plot.util.SeriesColorUtils
-
public class SeriesColorUtils extends Object
Utility methods to setXYChart.Series
's color.- Author:
- claudio.rosati@esss.se
-
-
Field Summary
Fields Modifier and Type Field Description static Color[]
COLORS
static Color
HORIZONTAL
static Color
LONGITUDINAL
static Color
VERTICAL
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
styleFor(Color color, int index)
Returns the style to be applied for a givenColor
to aXYChart.Series
.static String
styles()
static String
styles(int horizontal, int vertical, int longitudinal)
Return the styles string to be applied to a chart.
-
-
-
Method Detail
-
styleFor
public static String styleFor(Color color, int index)
Returns the style to be applied for a givenColor
to aXYChart.Series
.The returned style is obtained changing the
CHART_COLOR_i
,CHART_COLOR_i_TRANS_20
andCHART_COLOR_i_TRANS_70
standard JavaFX chart colors (where i is a number in the1..8
range) to the givencolor
.- Parameters:
color
- TheColor
for which CSS style string appropriate for a chartXYChart.Series
should be created.index
- The index of theXYChart.Series
in the chart. The( index % 8 ) + 1
value will be used to decide which of the 8 standard chart colors will be overridden in the returned style string.- Returns:
- A style string overriding one of the default JavaFx 8 chart colors with the given one.
- Throws:
NullPointerException
- Ifcolor
isnull
.IllegalArgumentException
- If (@code index} is negative.
-
styles
public static String styles()
- Returns:
- The default styles string for a chart.
-
styles
public static String styles(int horizontal, int vertical, int longitudinal)
Return the styles string to be applied to a chart.As in JavaFX 8 colors will be used. If the given indexes are non-negative, then special colors will be used to represent horizontal (red), vertical (blue) and longitudinal (green) series.
- Parameters:
horizontal
- The index of the horizontal series. If non-negative red will be used for the series.vertical
- The index of the vertical series. If non-negative blue will be used for the series.longitudinal
- The index of the longitudinal series. If non-negative red will be used for the series.- Returns:
- The styles string to be applied to a chart.
-
-