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 booleanaddMap(Map<Key,String> toAdd)Adds a map of values and colors to the colors container.voidclear()Removes all keys.IsColorgetColor(double value)Returns the stored color in the gradient, by a value of chart.IsColorgetColor(String value)Returns the stored color in the gradient, by a value of chart.IsColorgetColor(Date value)Returns the stored color in the gradient, by a value of chart.StringgetColorAsString(double value)Returns the stored color in the gradient, by a value of chart.StringgetColorAsString(String value)Returns the stored color in the gradient, by a value of chart.StringgetColorAsString(Date value)Returns the stored color in the gradient, by a value of chart.booleanloadMap(Map<Key,String> toLoad)Loads a map of values and colors to the colors container, removing all existing values.voidremove(double... values)Removes a color by keys.voidremove(String... values)Removes a color by keys.voidremove(Date... values)Removes a color by keys.voidsetColor(double value, String color)Sets a color in the gradient, by a value of chart.voidsetColor(double value, IsColor color)Sets a color in the gradient, by a value of chart.voidsetColor(String value, String color)Sets a color in the gradient, by a value of chart.voidsetColor(String value, IsColor color)Sets a color in the gradient, by a value of chart.voidsetColor(Date value, String color)Sets a color in the gradient, by a value of chart.voidsetColor(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, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, 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
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, 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:
trueif 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:
trueif the values and colors has been loaded, otherwisefalse
-
-