Package org.zkoss.chart
Class PlotLine
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.PlotLine
-
- All Implemented Interfaces:
Serializable,ClientEventHandler,OptionDataListener,org.zkoss.json.JSONAware
public class PlotLine extends Optionable implements ClientEventHandler
A plot line stretching across the plot area, marking a specific value on one of the axes.All the options in this class support
DynamicalAttribute.- Author:
- jumperchen, RaymondChao
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description PlotLine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEventListener(String evtnm, org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event> listener)Adds an event listener to this options.ColorgetColor()Returns the color of the line.StringgetDashStyle()Returns the dashing or dot style for the plot line.Iterable<org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event>>getEventListeners(String evtnm)Returns an iterative collection of the event listeners for the given event.Set<String>getEventNames()Returns all event names, if any.StringgetId()Returns an id used for identifying the plot line inAxis.removePlotLine(String)PlotLabelgetLabel()Returns text labels for the plot lineNumbergetValue()Returns the position of the line in axis units.NumbergetWidth()Returns the width or thickness of the plot line.NumbergetZIndex()Returns the z index of the plot line within the chart.booleanremoveEventListener(String evtnm, org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event> listener)Removes an event listener.voidsetColor(String color)Sets the color of the plot line.voidsetColor(Color color)Sets the color of the plot line.voidsetColor(LinearGradient color)Sets the color of the plot line.voidsetColor(RadialGradient color)Sets the color of the plot line.voidsetDashStyle(String dashStyle)Sets the dashing or dot style for the plot line.voidsetId(String id)Sets an id used for identifying the plot line inAxis.removePlotLine(String)voidsetLabel(PlotLabel label)Sets text labels for the plot linevoidsetValue(Number value)Sets the position of the line in axis units.voidsetWidth(Number width)Sets the width or thickness of the plot line.voidsetZIndex(Number zIndex)Sets the z index of the plot line within the chart.StringtoJSONString()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
-
-
-
-
Method Detail
-
getColor
public Color getColor()
Returns the color of the line.Default: null.
-
setColor
public void setColor(Color color)
Sets the color of the plot line.
-
setColor
public void setColor(String color)
Sets the color of the plot line.
-
setColor
public void setColor(LinearGradient color)
Sets the color of the plot line.
-
setColor
public void setColor(RadialGradient color)
Sets the color of the plot line.
-
getDashStyle
public String getDashStyle()
Returns the dashing or dot style for the plot line. For possible values see this overview.Default: "Solid".
-
setDashStyle
public void setDashStyle(String dashStyle)
Sets the dashing or dot style for the plot line. For possible values see this overview.
-
getId
public String getId()
Returns an id used for identifying the plot line inAxis.removePlotLine(String)Default: null.
-
setId
public void setId(String id)
Sets an id used for identifying the plot line inAxis.removePlotLine(String)Default: null.
-
getLabel
public PlotLabel getLabel()
Returns text labels for the plot lineDefault: an instance of PlotLabel.
-
setLabel
public void setLabel(PlotLabel label)
Sets text labels for the plot line
-
getValue
public Number getValue()
Returns the position of the line in axis units.Default: null.
-
setValue
public void setValue(Number value)
Sets the position of the line in axis units.
-
getWidth
public Number getWidth()
Returns the width or thickness of the plot line.Default: null.
-
setWidth
public void setWidth(Number width)
Sets the width or thickness of the plot line.
-
getZIndex
public Number getZIndex()
Returns the z index of the plot line within the chart.Default: null.
-
setZIndex
public void setZIndex(Number zIndex)
Sets the z index of the plot line within the chart.
-
addEventListener
public void addEventListener(String evtnm, org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event> listener)
Adds an event listener to this options.- Specified by:
addEventListenerin interfaceClientEventHandler- Parameters:
evtnm- what event to listen (never null), i.e. onClick, onMouseOver, and so on.- Since:
- 1.2.0
-
removeEventListener
public boolean removeEventListener(String evtnm, org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event> listener)
Removes an event listener.- Specified by:
removeEventListenerin interfaceClientEventHandler- Returns:
- whether the listener is removed; false if it was never added.
- Since:
- 1.2.0
-
getEventNames
public Set<String> getEventNames()
Returns all event names, if any.- Specified by:
getEventNamesin interfaceClientEventHandler- Since:
- 1.2.0
-
getEventListeners
public Iterable<org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event>> getEventListeners(String evtnm)
Returns an iterative collection of the event listeners for the given event.Note: it is OK to invoke
addEventListener(java.lang.String, org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event>)orremoveEventListener(java.lang.String, org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event>)when iterating through the event listeners with the returned collection.To remove an event listener from the returned iterative collection, you could invoke
Iterable.iterator()'sIterator.remove().- Specified by:
getEventListenersin interfaceClientEventHandler- Since:
- 1.2.0
-
toJSONString
public String toJSONString()
Description copied from class:OptionableEncodes this object to a JSON string. It is the same asOptionable.toString().- Specified by:
toJSONStringin interfaceorg.zkoss.json.JSONAware- Overrides:
toJSONStringin classOptionable
-
-