Class Colors
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.gradient.Colors
-
public final class Colors extends AbstractNode
Is a map to apply the color stop of the gradient in relation with the data of the chart.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addMap(Map<Key,String> toAdd)
Adds a map of values and colors to the colors container.void
clear()
Removes all keys.IsColor
getColor(double value)
Returns the stored color in the gradient, by a value of chart.IsColor
getColor(String value)
Returns the stored color in the gradient, by a value of chart.IsColor
getColor(Date value)
Returns the stored color in the gradient, by a value of chart.String
getColorAsString(double value)
Returns the stored color in the gradient, by a value of chart.String
getColorAsString(String value)
Returns the stored color in the gradient, by a value of chart.String
getColorAsString(Date value)
Returns the stored color in the gradient, by a value of chart.boolean
loadMap(Map<Key,String> toLoad)
Loads a map of values and colors to the colors container, removing all existing values.void
remove(double... values)
Removes a color by keys.void
remove(String... values)
Removes a color by keys.void
remove(Date... values)
Removes a color by keys.void
setColor(double value, String color)
Sets a color in the gradient, by a value of chart.void
setColor(double value, IsColor color)
Sets a color in the gradient, by a value of chart.void
setColor(String value, String color)
Sets a color in the gradient, by a value of chart.void
setColor(String value, IsColor color)
Sets a color in the gradient, by a value of chart.void
setColor(Date value, String color)
Sets a color in the gradient, by a value of chart.void
setColor(Date value, IsColor color)
Sets a color in the gradient, by a value of chart.Map<Key,String>
toMap()
Exports the values and the colors in a map.-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, getUpdateListener, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setUpdateListener, setValueAndAddToParent, setValueAndAddToParent, 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
checkAndGetColor, 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, 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, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Method Detail
-
clear
public void clear()
Removes all keys.
-
setColor
public void setColor(String value, IsColor color)
Sets a color in the gradient, by a value of chart.- Parameters:
value
- the value of the chart where the color stop has been appliedcolor
- the color assigned at passed chart value.
-
setColor
public void setColor(String value, String color)
Sets a color in the gradient, by a value of chart.- Parameters:
value
- the value of the chart where the color stop has been appliedcolor
- the color assigned at passed chart value.
-
getColorAsString
public String getColorAsString(String value)
Returns the stored color in the gradient, by a value of chart.- Parameters:
value
- the value of the chart where the color stop has been applied- Returns:
- the color assigned at passed chart value.
-
getColor
public IsColor getColor(String value)
Returns the stored color in the gradient, by a value of chart.- Parameters:
value
- the value of the chart where the color stop has been applied- Returns:
- the color assigned at passed chart value.
-
remove
public void remove(String... values)
Removes a color by keys.- Parameters:
values
- the values of the chart where the color stop has been applied
-
setColor
public void setColor(double value, IsColor color)
Sets a color in the gradient, by a value of chart.- Parameters:
value
- the value of the chart where the color stop has been appliedcolor
- the color assigned at passed chart value.
-
setColor
public void setColor(double value, String color)
Sets a color in the gradient, by a value of chart.- Parameters:
value
- the value of the chart where the color stop has been appliedcolor
- the color assigned at passed chart value.
-
getColorAsString
public String getColorAsString(double value)
Returns the stored color in the gradient, by a value of chart.- Parameters:
value
- the value of the chart where the color stop has been applied- Returns:
- the color assigned at passed chart value.
-
getColor
public IsColor getColor(double value)
Returns the stored color in the gradient, by a value of chart.- Parameters:
value
- the value of the chart where the color stop has been applied- Returns:
- the color assigned at passed chart value.
-
remove
public void remove(double... values)
Removes a color by keys.- Parameters:
values
- the values of the chart where the color stop has been applied
-
setColor
public void setColor(Date value, IsColor color)
Sets a color in the gradient, by a value of chart.- Parameters:
value
- the value of the chart where the color stop has been appliedcolor
- the color assigned at passed chart value.
-
setColor
public void setColor(Date value, String color)
Sets a color in the gradient, by a value of chart.- Parameters:
value
- the value of the chart where the color stop has been appliedcolor
- the color assigned at passed chart value.
-
getColorAsString
public String getColorAsString(Date value)
Returns the stored color in the gradient, by a value of chart.- Parameters:
value
- the value of the chart where the color stop has been applied- Returns:
- the color assigned at passed chart value.
-
getColor
public IsColor getColor(Date value)
Returns the stored color in the gradient, by a value of chart.- Parameters:
value
- the value of the chart where the color stop has been applied- Returns:
- the color assigned at passed chart value.
-
remove
public void remove(Date... values)
Removes a color by keys.- Parameters:
values
- the values of the chart where the color stop has been applied
-
addMap
public boolean addMap(Map<Key,String> toAdd)
Adds a map of values and colors to the colors container.- Parameters:
toAdd
- map to add to container- Returns:
true
if the values and colors has been loaded, otherwisefalse
-
loadMap
public boolean loadMap(Map<Key,String> toLoad)
Loads a map of values and colors to the colors container, removing all existing values.- Parameters:
toLoad
- map to load to container- Returns:
true
if the values and colors has been loaded, otherwisefalse
-
-