Package org.zkoss.chart
Class LinearGradient
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.LinearGradient
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
public class LinearGradient extends Optionable
A linear gradient is a smooth transition from one color to another. In addition, several color transitions can be applied to the same element.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 LinearGradient(double x1, double y1, double x2, double y2)
The x1, x2, y1,y2 attributes of the linearGradient define the start and end position of the gradient
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStop(double index, String color)
Adds the color range for a gradient can be composed of two or more colors.List<Stop>
getStops()
Returns the all stopsvoid
setStops(String color1, String color2)
Sets the color range for a gradient can be composed of two colors.void
setStops(List<Stop> stops)
Sets the color range for a gradient can be composed of two or more colors.void
setStops(Stop... stops)
Sets the color range for a gradient can be composed of two or more colors.-
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
-
addStop
public void addStop(double index, String color)
Adds the color range for a gradient can be composed of two or more colors. Each color is specified with a offset in order.
-
setStops
public void setStops(String color1, String color2)
Sets the color range for a gradient can be composed of two colors. It is the same as
setStops(new Stop(0, color1), new Stop(1, color2));
- See Also:
setStops(Stop... stops)
-
setStops
public void setStops(List<Stop> stops)
Sets the color range for a gradient can be composed of two or more colors. Each color is specified with a offset in order.For example,
setStops(Arrays.asList( new Stop[]{ new Stop(0, "rgb(255, 255, 255)"), new Stop(1, "rgb(200, 200, 255)") } ));
-
setStops
public void setStops(Stop... stops)
Sets the color range for a gradient can be composed of two or more colors. Each color is specified with a offset in order.For example,
setStops(new Stop(0, "rgb(255, 255, 255)"), new Stop(1, "rgb(200, 200, 255)"));
-
-