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 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.Color
getColor()
Returns the color of the line.String
getDashStyle()
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.String
getId()
Returns an id used for identifying the plot line inAxis.removePlotLine(String)
PlotLabel
getLabel()
Returns text labels for the plot lineNumber
getValue()
Returns the position of the line in axis units.Number
getWidth()
Returns the width or thickness of the plot line.Number
getZIndex()
Returns the z index of the plot line within the chart.boolean
removeEventListener(String evtnm, org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event> listener)
Removes an event listener.void
setColor(String color)
Sets the color of the plot line.void
setColor(Color color)
Sets the color of the plot line.void
setColor(LinearGradient color)
Sets the color of the plot line.void
setColor(RadialGradient color)
Sets the color of the plot line.void
setDashStyle(String dashStyle)
Sets the dashing or dot style for the plot line.void
setId(String id)
Sets an id used for identifying the plot line inAxis.removePlotLine(String)
void
setLabel(PlotLabel label)
Sets text labels for the plot linevoid
setValue(Number value)
Sets the position of the line in axis units.void
setWidth(Number width)
Sets the width or thickness of the plot line.void
setZIndex(Number zIndex)
Sets the z index of the plot line within the chart.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
-
-
-
-
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:
addEventListener
in 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:
removeEventListener
in 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:
getEventNames
in 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:
getEventListeners
in interfaceClientEventHandler
- Since:
- 1.2.0
-
toJSONString
public String toJSONString()
Description copied from class:Optionable
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
-
-