Package org.zkoss.chart
Class Annotation
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.Annotation
-
- All Implemented Interfaces:
Serializable,OptionDataListener,org.zkoss.json.JSONAware
public class Annotation extends Optionable
A basic type of an annotation. It allows to add custom labels or shapes. The items can be tied to points, axis coordinates or chart pixel coordinates.- Since:
- 7.2.1.0
- Author:
- rudyhuang
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAnnotation.PointThis object defines the point to which the label or shape will be connected.
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description Annotation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetClassName()Returns a class name for styling the annotation by CSS.StringgetDraggable()Allow an annotation to be draggable by a user.ObjectgetId()Returns an ID for an annotation.AnnotationLabelOptionsgetLabelOptions()Returns options for annotation's labels.List<AnnotationLabel>getLabels()Returns the list of labels for the annotation.AnnotationShapeOptionsgetShapeOptions()Returns options for annotation's shapes.List<AnnotationShape>getShapes()Returns the list of shapes for the annotation.NumbergetZIndex()Returns the Z index of the annotation.booleanisCrop()Returns whether to hide the part of the annotation that is outside the plot area.booleanisVisible()Returns whether the annotation is visible.voidsetClassName(String className)Sets a class name for styling the annotation by CSS.voidsetCrop(boolean crop)Sets whether to hide the part of the annotation that is outside the plot area.voidsetDraggable(String draggable)Allow an annotation to be draggable by a user.voidsetId(Number id)Sets an ID for an annotation.voidsetId(String id)Sets an ID for an annotation.voidsetLabelOptions(AnnotationLabelOptions labelOptions)Sets options for annotation's labels.voidsetLabels(List<AnnotationLabel> labels)Sets a list of labels for the annotation.voidsetLabels(AnnotationLabel... labels)Sets an array of labels for the annotation.voidsetShapeOptions(AnnotationShapeOptions shapeOptions)Sets options for annotation's shapes.voidsetShapes(List<AnnotationShape> shapes)Sets a list of shapes for the annotation.voidsetShapes(AnnotationShape... shapes)Sets an array of shapes for the annotation.voidsetVisible(boolean visible)Sets whether the annotation is visible.voidsetZIndex(Number zIndex)Sets the Z index of the annotation.-
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 a class name for styling the annotation by CSS.Default: null.
- Since:
- 13.1.1.0
-
setClassName
public void setClassName(String className)
Sets a class name for styling the annotation by CSS.- Since:
- 13.1.1.0
-
isCrop
public boolean isCrop()
Returns whether to hide the part of the annotation that is outside the plot area.Default:
true- Since:
- 10.2.1.0
-
setCrop
public void setCrop(boolean crop)
Sets whether to hide the part of the annotation that is outside the plot area.Default:
true- Since:
- 10.2.1.0
-
getDraggable
public String getDraggable()
Allow an annotation to be draggable by a user. Possible values are "x", "xy", "y" and "" (disabled).Default: xy
-
setDraggable
public void setDraggable(String draggable)
Allow an annotation to be draggable by a user. Possible values are "x", "xy", "y" and "" (disabled).
-
getId
public Object getId()
Returns an ID for an annotation. Can be user later when removing an annotation in removeAnnotation(id) method.Default: null
-
setId
public void setId(String id)
Sets an ID for an annotation.
-
setId
public void setId(Number id)
Sets an ID for an annotation.
-
getLabelOptions
public AnnotationLabelOptions getLabelOptions()
Returns options for annotation's labels. Each label inherits options from the labelOptions object. An option from the labelOptions can be overwritten by config for a specific label.
-
setLabelOptions
public void setLabelOptions(AnnotationLabelOptions labelOptions)
Sets options for annotation's labels. Each label inherits options from the labelOptions object. An option from the labelOptions can be overwritten by config for a specific label.
-
getLabels
public List<AnnotationLabel> getLabels()
Returns the list of labels for the annotation.
-
setLabels
public void setLabels(List<AnnotationLabel> labels)
Sets a list of labels for the annotation. For options that apply to multiple labels, they can be added to thesetLabelOptions(org.zkoss.chart.AnnotationLabelOptions).
-
setLabels
public void setLabels(AnnotationLabel... labels)
Sets an array of labels for the annotation.
-
getShapeOptions
public AnnotationShapeOptions getShapeOptions()
Returns options for annotation's shapes. Each shape inherits options from the shapeOptions object. An option from the shapeOptions can be overwritten by config for a specific shape.
-
setShapeOptions
public void setShapeOptions(AnnotationShapeOptions shapeOptions)
Sets options for annotation's shapes. Each shape inherits options from the shapeOptions object. An option from the shapeOptions can be overwritten by config for a specific shape.
-
getShapes
public List<AnnotationShape> getShapes()
Returns the list of shapes for the annotation.
-
setShapes
public void setShapes(List<AnnotationShape> shapes)
Sets a list of shapes for the annotation. For options that apply to multiple shapes, they can be added to thesetShapeOptions(org.zkoss.chart.AnnotationShapeOptions).
-
setShapes
public void setShapes(AnnotationShape... shapes)
Sets an array of shapes for the annotation.
-
isVisible
public boolean isVisible()
Returns whether the annotation is visible.Default: true
-
setVisible
public void setVisible(boolean visible)
Sets whether the annotation is visible.
-
getZIndex
public Number getZIndex()
Returns the Z index of the annotation.Default: 6
-
setZIndex
public void setZIndex(Number zIndex)
Sets the Z index of the annotation.
-
-