Package org.zkoss.chart
Class PaletteScheme
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.PaletteScheme
-
- All Implemented Interfaces:
Serializable,OptionDataListener,org.zkoss.json.JSONAware
public class PaletteScheme extends Optionable
The palette options for one color scheme, light or dark mode. SeePalette.getLight()andPalette.getDark().The background, neutral and highlight colors are blended into CSS variables. For example,
var(--highcharts-neutral-color-60)is 60% of the neutral color and 40% of the background color. The palette only accepts plain colors, not gradients or patterns.All the options in this class support
DynamicalAttribute.- Since:
- 13.1.1.0
- Author:
- peggypeng
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description PaletteScheme()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColorgetBackgroundColor()Returns the chart background color, also used for the point stroke of markers and columns, and as the base of the blended neutral and highlight colors.List<Color>getColors()Returns the colors for data series and points in this mode.ColorgetHighlightColor()Returns the highlight color, the base of the blended highlight colors used for highlighted or active elements, like the zoom selection marker and clickable drilldown labels.ColorgetNegativeColor()Returns the negative color used in stock charts, such as for technical indicators, annotations or hollow candlestick series.ColorgetNeutralColor()Returns the neutral color, the base of the blended neutral colors used for text, lines, borders and most other elements except the data.ColorgetPositiveColor()Returns the positive color used in stock charts, such as for technical indicators, annotations or hollow candlestick series.voidsetBackgroundColor(String color)Sets the chart background color, also used for the point stroke of markers and columns, and as the base of the blended neutral and highlight colors.voidsetBackgroundColor(Color color)Sets the chart background color, also used for the point stroke of markers and columns, and as the base of the blended neutral and highlight colors.voidsetColors(String... source)Sets the colors for data series and points in this mode.voidsetColors(List<Color> colors)Sets the colors for data series and points in this mode.voidsetHighlightColor(String color)Sets the highlight color, the base of the blended highlight colors used for highlighted or active elements, like the zoom selection marker and clickable drilldown labels.voidsetHighlightColor(Color color)Sets the highlight color, the base of the blended highlight colors used for highlighted or active elements, like the zoom selection marker and clickable drilldown labels.voidsetNegativeColor(String color)Sets the negative color used in stock charts, such as for technical indicators, annotations or hollow candlestick series.voidsetNegativeColor(Color color)Sets the negative color used in stock charts, such as for technical indicators, annotations or hollow candlestick series.voidsetNeutralColor(String color)Sets the neutral color, the base of the blended neutral colors used for text, lines, borders and most other elements except the data.voidsetNeutralColor(Color color)Sets the neutral color, the base of the blended neutral colors used for text, lines, borders and most other elements except the data.voidsetPositiveColor(String color)Sets the positive color used in stock charts, such as for technical indicators, annotations or hollow candlestick series.voidsetPositiveColor(Color color)Sets the positive color used in stock charts, such as for technical indicators, annotations or hollow candlestick series.-
Methods inherited from class org.zkoss.chart.Optionable
addExtraAttr, addOptionDataListener, clearOptonDataListener, clone, containsKey, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getAttr, getAttr, getClientState, getExtraAttr, merge, onChange, removeExtraAttr, removeKey, removeOptionDataListener, setAttr, setAttr, setAttr, setAttr, toJSONString, toString
-
-
-
-
Method Detail
-
getBackgroundColor
public Color getBackgroundColor()
Returns the chart background color, also used for the point stroke of markers and columns, and as the base of the blended neutral and highlight colors.Default: null
-
setBackgroundColor
public void setBackgroundColor(Color color)
Sets the chart background color, also used for the point stroke of markers and columns, and as the base of the blended neutral and highlight colors. Defaults to "#ffffff" in light mode and "#141414" in dark mode.
-
setBackgroundColor
public void setBackgroundColor(String color)
Sets the chart background color, also used for the point stroke of markers and columns, and as the base of the blended neutral and highlight colors. Defaults to "#ffffff" in light mode and "#141414" in dark mode.
-
getColors
public List<Color> getColors()
Returns the colors for data series and points in this mode.Default: null
-
setColors
public void setColors(List<Color> colors)
Sets the colors for data series and points in this mode. They replace the colors ofPalette.getColors()item by item; a null item keeps the general color.
-
setColors
public void setColors(String... source)
Sets the colors for data series and points in this mode. They replace the colors ofPalette.getColors()item by item; a null item keeps the general color.
-
getHighlightColor
public Color getHighlightColor()
Returns the highlight color, the base of the blended highlight colors used for highlighted or active elements, like the zoom selection marker and clickable drilldown labels.Default: null
-
setHighlightColor
public void setHighlightColor(Color color)
Sets the highlight color, the base of the blended highlight colors used for highlighted or active elements, like the zoom selection marker and clickable drilldown labels. Defaults to "#0022ff" in light mode and "#2caffe" in dark mode.
-
setHighlightColor
public void setHighlightColor(String color)
Sets the highlight color, the base of the blended highlight colors used for highlighted or active elements, like the zoom selection marker and clickable drilldown labels. Defaults to "#0022ff" in light mode and "#2caffe" in dark mode.
-
getNegativeColor
public Color getNegativeColor()
Returns the negative color used in stock charts, such as for technical indicators, annotations or hollow candlestick series.Default: null
-
setNegativeColor
public void setNegativeColor(Color color)
Sets the negative color used in stock charts, such as for technical indicators, annotations or hollow candlestick series. Defaults to "#f21313"; dark mode uses the light mode color unless set.
-
setNegativeColor
public void setNegativeColor(String color)
Sets the negative color used in stock charts, such as for technical indicators, annotations or hollow candlestick series. Defaults to "#f21313"; dark mode uses the light mode color unless set.
-
getNeutralColor
public Color getNeutralColor()
Returns the neutral color, the base of the blended neutral colors used for text, lines, borders and most other elements except the data.Default: null
-
setNeutralColor
public void setNeutralColor(Color color)
Sets the neutral color, the base of the blended neutral colors used for text, lines, borders and most other elements except the data. Defaults to "#000000" in light mode and "#ffffff" in dark mode.
-
setNeutralColor
public void setNeutralColor(String color)
Sets the neutral color, the base of the blended neutral colors used for text, lines, borders and most other elements except the data. Defaults to "#000000" in light mode and "#ffffff" in dark mode.
-
getPositiveColor
public Color getPositiveColor()
Returns the positive color used in stock charts, such as for technical indicators, annotations or hollow candlestick series.Default: null
-
setPositiveColor
public void setPositiveColor(Color color)
Sets the positive color used in stock charts, such as for technical indicators, annotations or hollow candlestick series. Defaults to "#06b535"; dark mode uses the light mode color unless set.
-
setPositiveColor
public void setPositiveColor(String color)
Sets the positive color used in stock charts, such as for technical indicators, annotations or hollow candlestick series. Defaults to "#06b535"; dark mode uses the light mode color unless set.
-
-