Package org.zkoss.chart
Class Color
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.Color
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
public class Color extends Optionable
A color option wrap for String type,LinearGradient
, orRadialGradient
All the options in this class support
DynamicalAttribute
.- Author:
- jumperchen
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description Color(String color)
Constructs with a string color.Color(LinearGradient color)
Constructs with a linear gradient color.Color(RadialGradient color)
Constructs with a radial gradient color.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinearGradient
linearValue()
Returns the linear gradient format's color, if any.RadialGradient
radialValue()
Returns the radial gradient format's color, if any.void
setColor(String color)
Sets the color with string format.void
setColor(LinearGradient linear)
Sets the color with linear gradient format.void
setColor(RadialGradient radial)
Sets the color with radial gradient format.String
stringValue()
Returns the string format's color, if any.String
toJSONString()
Encodes this object to a JSON string.-
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, toString
-
-
-
-
Constructor Detail
-
Color
public Color(String color)
Constructs with a string color.
-
Color
public Color(LinearGradient color)
Constructs with a linear gradient color.
-
Color
public Color(RadialGradient color)
Constructs with a radial gradient color.
-
-
Method Detail
-
setColor
public void setColor(String color)
Sets the color with string format.- Parameters:
color
-
-
setColor
public void setColor(LinearGradient linear)
Sets the color with linear gradient format.- Parameters:
linear
-
-
setColor
public void setColor(RadialGradient radial)
Sets the color with radial gradient format.- Parameters:
radial
-
-
stringValue
public String stringValue()
Returns the string format's color, if any.
-
linearValue
public LinearGradient linearValue()
Returns the linear gradient format's color, if any.
-
radialValue
public RadialGradient radialValue()
Returns the radial gradient format's color, if any.
-
toJSONString
public String toJSONString()
Encodes this object to a JSON string. It is the same asOptionable.toString()
.- Specified by:
toJSONString
in interfaceorg.zkoss.json.JSONAware
- Overrides:
toJSONString
in classOptionable
-
-