Package org.zkoss.chart
Class Crosshair
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.Crosshair
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
public class Crosshair extends Optionable
Configure a crosshair that follows either the mouse pointer or the hovered point.- Author:
- Christopher
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description Crosshair()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getClassName()
Returns the class name for the crosshair, especially as a hook for styling.Color
getColor()
The color of the crosshairString
getDashStyle()
Get the dash style for the crosshair.boolean
getSnap()
Get whether the crosshair should snap to the point or follow the pointer independent of points.Number
getWidth()
Get the pixel width of the crosshair.Number
getZIndex()
Get the Z index of the crosshair.Boolean
isEnabled()
Returns enable or disable the crosshair.void
setClassName(String className)
Sets the class name for the crosshair, especially as a hook for styling.void
setColor(String color)
The color of the crosshairvoid
setColor(Color color)
The color of the crosshairvoid
setColor(LinearGradient color)
The color of the crosshairvoid
setColor(RadialGradient color)
The color of the crosshairvoid
setDashStyle(String dashStyle)
Set the dash style for the crosshair.void
setEnabled(Boolean enabled)
Sets enable or disable the crosshair.void
setSnap(boolean snap)
Set whether the crosshair should snap to the point or follow the pointer independent of points.void
setWidth(Number width)
Set the pixel width of the crosshair.void
setZIndex(Number zIndex)
Set the Z index of the crosshair.-
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
-
getClassName
public String getClassName()
Returns the class name for the crosshair, especially as a hook for styling.Default: ""
- Since:
- 11.2.0.0
-
setClassName
public void setClassName(String className)
Sets the class name for the crosshair, especially as a hook for styling.- Since:
- 11.2.0.0
-
getColor
public Color getColor()
The color of the crosshairDefault: #C0C0C0
- Since:
- 2.1.1
-
setColor
public void setColor(Color color)
The color of the crosshair- Since:
- 2.1.1
-
setColor
public void setColor(String color)
The color of the crosshair- Since:
- 2.1.1
-
setColor
public void setColor(LinearGradient color)
The color of the crosshair- Since:
- 2.1.1
-
setColor
public void setColor(RadialGradient color)
The color of the crosshair- Since:
- 2.1.1
-
getDashStyle
public String getDashStyle()
Get the dash style for the crosshair.Defaults to "Solid"
- Returns:
- the dash style
- Since:
- 2.1.1
-
setDashStyle
public void setDashStyle(String dashStyle)
Set the dash style for the crosshair.Only the following values are allowed:
- Solid
- ShortDash
- ShortDot
- ShortDashDot
- ShortDashDotDot
- Dot
- Dash
- LongDash
- DashDot
- LongDashDot
- LongDashDotDot
- Since:
- 2.1.1
-
isEnabled
public Boolean isEnabled()
Returns enable or disable the crosshair.Default: null
- Since:
- 11.2.0.0
-
setEnabled
public void setEnabled(Boolean enabled)
Sets enable or disable the crosshair.Default: null
- Since:
- 11.2.0.0
-
getSnap
public boolean getSnap()
Get whether the crosshair should snap to the point or follow the pointer independent of points.Defaults to true.
- Since:
- 2.1.1
-
setSnap
public void setSnap(boolean snap)
Set whether the crosshair should snap to the point or follow the pointer independent of points.- Since:
- 2.1.1
-
getWidth
public Number getWidth()
Get the pixel width of the crosshair.Defaults to 1
- Since:
- 2.1.1
-
setWidth
public void setWidth(Number width)
Set the pixel width of the crosshair.- Since:
- 2.1.1
-
getZIndex
public Number getZIndex()
Get the Z index of the crosshair. Higher Z indices allow drawing the crosshair on top of the series or behind the grid lines.Defaults to 2.
- Since:
- 2.1.1
-
setZIndex
public void setZIndex(Number zIndex)
Set the Z index of the crosshair. Higher Z indices allow drawing the crosshair on top of the series or behind the grid lines.- Since:
- 2.1.1
-
-