Class ColorSchemesOptions
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.plugins.AbstractPluginOptions
-
- org.pepstock.charba.client.impl.plugins.ColorSchemesOptions
-
public final class ColorSchemesOptions extends AbstractPluginOptions
This is the object to map theColorSchemes.ID
plugin options, both at chart and global level.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_BACKGROUND_ALPHA
Default transparency value for the background color, 0.5.static boolean
DEFAULT_REVERSE
Default the order of the colors in the selected scheme is reversed, false.static ColorScheme
DEFAULT_SCHEME
Default color scheme,BrewerScheme.PAIRED12
.static String
DEFAULT_SCHEME_CATEGORY
Default category when new color scheme has been created on top of the available schemes, "custom".static SchemeScope
DEFAULT_SCHEME_SCOPE
Default color scheme scope (for bar and bubble charts),SchemeScope.DATASET
.
-
Constructor Summary
Constructors Constructor Description ColorSchemesOptions()
Builds the object with new java script object setting the default value of plugin.
The global plugin options is used, if exists, as defaults values.ColorSchemesOptions(IsChart chart)
Builds the object with a chart instance in order to get the right defaults.
If the plugin options have not been set by chart type, it will use the global.
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description double
getBackgroundColorAlpha()
The transparency value for the background color.ColorScheme
getScheme()
Returns the color scheme.default String
getSchemeCategory()
Returns the color scheme category.default String
getSchemeName()
Returns the color scheme name.SchemeScope
getSchemeScope()
Returns the color scheme scope when the scheme is applied to hoving flex datasets, like bars charts.boolean
isReverse()
If set totrue
, the order of the colors in the selected scheme is reversed.void
setBackgroundColorAlpha(double backgroundColorAlpha)
The transparency value for the background color.void
setReverse(boolean reverse)
If set totrue
, the order of the colors in the selected scheme is reversed.void
setScheme(ColorScheme scheme)
Sets the color scheme.void
setSchemeScope(SchemeScope schemeScope)
Sets the color scheme scope when the scheme is applied to hoving flex datasets, like bars charts.-
Methods inherited from class org.pepstock.charba.client.plugins.AbstractPluginOptions
applyingDefaults, applyingDefaults, getEvents, getId, getPluginId, loadGlobalsPluginOptions, setEvents, setEvents, store, store, store, store
-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Field Detail
-
DEFAULT_SCHEME
public static final ColorScheme DEFAULT_SCHEME
Default color scheme,BrewerScheme.PAIRED12
.
-
DEFAULT_SCHEME_SCOPE
public static final SchemeScope DEFAULT_SCHEME_SCOPE
Default color scheme scope (for bar and bubble charts),SchemeScope.DATASET
.
-
DEFAULT_BACKGROUND_ALPHA
public static final double DEFAULT_BACKGROUND_ALPHA
Default transparency value for the background color, 0.5.- See Also:
- Constant Field Values
-
DEFAULT_REVERSE
public static final boolean DEFAULT_REVERSE
Default the order of the colors in the selected scheme is reversed, false.- See Also:
- Constant Field Values
-
DEFAULT_SCHEME_CATEGORY
public static final String DEFAULT_SCHEME_CATEGORY
Default category when new color scheme has been created on top of the available schemes, "custom".- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ColorSchemesOptions
public ColorSchemesOptions()
Builds the object with new java script object setting the default value of plugin.
The global plugin options is used, if exists, as defaults values.
-
ColorSchemesOptions
public ColorSchemesOptions(IsChart chart)
Builds the object with a chart instance in order to get the right defaults.
If the plugin options have not been set by chart type, it will use the global.- Parameters:
chart
- chart instance related to the plugin options
-
-
Method Detail
-
setSchemeScope
public void setSchemeScope(SchemeScope schemeScope)
Sets the color scheme scope when the scheme is applied to hoving flex datasets, like bars charts.- Parameters:
schemeScope
- the color scheme scope when the scheme is applied to hoving flex datasets, like bars charts.
-
getSchemeScope
public SchemeScope getSchemeScope()
Returns the color scheme scope when the scheme is applied to hoving flex datasets, like bars charts.- Returns:
- the color scheme scope when the scheme is applied to hoving flex datasets, like bars charts
-
setScheme
public void setScheme(ColorScheme scheme)
Sets the color scheme.- Parameters:
scheme
- the color scheme.
-
getScheme
public ColorScheme getScheme()
Returns the color scheme.- Returns:
- the color scheme
-
setBackgroundColorAlpha
public void setBackgroundColorAlpha(double backgroundColorAlpha)
The transparency value for the background color. Must be a number between 0.0 (fully transparent) and 1.0 (no transparency).- Parameters:
backgroundColorAlpha
- the transparency value for the background color
-
getBackgroundColorAlpha
public double getBackgroundColorAlpha()
The transparency value for the background color. Must be a number between 0.0 (fully transparent) and 1.0 (no transparency).- Returns:
- the transparency value for the background color
-
setReverse
public void setReverse(boolean reverse)
If set totrue
, the order of the colors in the selected scheme is reversed.- Parameters:
reverse
- if set totrue
, the order of the colors in the selected scheme is reversed
-
isReverse
public boolean isReverse()
If set totrue
, the order of the colors in the selected scheme is reversed.- Returns:
- if set to
true
, the order of the colors in the selected scheme is reversed
-
getSchemeCategory
public default String getSchemeCategory()
Returns the color scheme category.- Returns:
- the color scheme category
-
getSchemeName
public default String getSchemeName()
Returns the color scheme name.- Returns:
- the color scheme name
-
-