Class 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
    • Constructor Detail

      • Annotation

        public Annotation()
    • Method Detail

      • 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​(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​(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.