Class DragDrop

  • All Implemented Interfaces:
    Serializable, OptionDataListener, org.zkoss.json.JSONAware

    public class DragDrop
    extends Optionable
    The draggable-points module allows points to be moved around or modified in the chart. In addition to the options mentioned under the dragDrop API structure, the module fires three events, point.dragStart, point.drag and point.drop.
    Since:
    7.2.1.0
    Author:
    rudyhuang
    See Also:
    Serialized Form
    • Constructor Detail

      • DragDrop

        public DragDrop()
    • Method Detail

      • isDraggableX

        public boolean isDraggableX()
        Returns if enable dragging in the X dimension. Note that this is not supported for TreeGrid axes (the default axis type in Gantt charts).

        Default: false

      • setDraggableX

        public void setDraggableX​(boolean draggableX)
        Sets if enable dragging in the X dimension. Note that this is not supported for TreeGrid axes (the default axis type in Gantt charts).
      • isDraggableX1

        public boolean isDraggableX1()
        (X-Range) Returns if enable dragging x value individually.

        Default: true

      • setDraggableX1

        public void setDraggableX1​(boolean draggableX1)
        (X-Range) Sets if enable dragging x value individually.
      • isDraggableX2

        public boolean isDraggableX2()
        (X-Range) Returns if enable dragging x2 value individually.

        Default: true

      • setDraggableX2

        public void setDraggableX2​(boolean draggableX2)
        (X-Range) Sets if enable dragging x2 value individually.
      • isDraggableY

        public boolean isDraggableY()
        Returns if enable dragging in the Y dimension. Note that this is not supported for TreeGrid axes (the default axis type in Gantt charts).

        Default: false

      • setDraggableY

        public void setDraggableY​(boolean draggableY)
        Sets if enable dragging in the Y dimension. Note that this is not supported for TreeGrid axes (the default axis type in Gantt charts).
      • getDragHandle

        public DragDrop.DragHandle getDragHandle()
        Returns the options for the drag handles, if any. Otherwise, create a new one.
      • setDragHandle

        public void setDragHandle​(DragDrop.DragHandle dragHandle)
        Sets the options for the drag handles.
      • getDragMaxX

        public Number getDragMaxX()
        Returns the maximum X value the points can be moved to.

        Default: null

      • setDragMaxX

        public void setDragMaxX​(Number dragMaxX)
        Sets the maximum X value the points can be moved to.
      • getDragMaxY

        public Number getDragMaxY()
        Returns the maximum Y value the points can be moved to.

        Default: null

      • setDragMaxY

        public void setDragMaxY​(Number dragMaxY)
        Sets the maximum Y value the points can be moved to.
      • getDragMinX

        public Number getDragMinX()
        Returns the minimum X value the points can be moved to.

        Default: null

      • setDragMinX

        public void setDragMinX​(Number dragMinX)
        Sets the minimum X value the points can be moved to.
      • getDragMinY

        public Number getDragMinY()
        Returns the minimum Y value the points can be moved to.

        Default: null

      • setDragMinY

        public void setDragMinY​(Number dragMinY)
        Sets the minimum Y value the points can be moved to.
      • getDragPrecisionX

        public Number getDragPrecisionX()
        Returns the X precision value to drag to for this series. Set to 0 to disable. By default this is disabled, except for category axes, where the default is 1.

        Default: 0

      • setDragPrecisionX

        public void setDragPrecisionX​(Number dragPrecisionX)
        Sets the X precision value to drag to for this series. Set to 0 to disable. By default this is disabled, except for category axes, where the default is 1.
      • getDragPrecisionY

        public Number getDragPrecisionY()
        Returns the Y precision value to drag to for this series. Set to 0 to disable. By default this is disabled, except for category axes, where the default is 1.

        Default: 0

      • setDragPrecisionY

        public void setDragPrecisionY​(Number dragPrecisionY)
        Sets the Y precision value to drag to for this series. Set to 0 to disable. By default this is disabled, except for category axes, where the default is 1.
      • getDragSensitivity

        public Number getDragSensitivity()
        Returns the amount of pixels to drag the pointer before it counts as a drag operation. This prevents drag/drop to fire when just clicking or selecting points.

        Default: 2

      • setDragSensitivity

        public void setDragSensitivity​(Number dragSensitivity)
        Sets the amount of pixels to drag the pointer before it counts as a drag operation. This prevents drag/drop to fire when just clicking or selecting points.
      • getGroupBy

        public String getGroupBy()
        Returns a property to group the points. Points with the same property value will be grouped together when moving.

        Default: null

      • setGroupBy

        public void setGroupBy​(String groupBy)
        Sets a property to group the points. Points with the same property value will be grouped together when moving.
      • getGuideBox

        public DragDrop.GuideBox getGuideBox()
        Returns the style options for the guide box, if any. Otherwise, create a new one. The guide box has one state by default, the default state.
      • setGuideBox

        public void setGuideBox​(DragDrop.GuideBox guideBox)
        Sets the style options for the guide box. The guide box has one state by default, the default state.
      • isLiveRedraw

        public boolean isLiveRedraw()
        Returns if updates points as they are dragged. If false, a guide box is drawn to illustrate the new point size.

        Default: true

      • setLiveRedraw

        public void setLiveRedraw​(boolean liveRedraw)
        Sets if updates points as they are dragged. If false, a guide box is drawn to illustrate the new point size.