Class EllipseAnnotation


  • public final class EllipseAnnotation
    extends AbstractAnnotation
    Implements a ELLIPSE annotation which draws a ellipse in the a chart.
    If one of the axes is not specified, the ellipse will take the entire chart dimension.
    The 4 coordinates, xMin, xMax, yMin, yMax are optional. If not specified, the ellipse is expanded out to the edges.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • EllipseAnnotation

        public EllipseAnnotation​(String id)
        Creates a ellipse annotation to be added to an AnnotationOptions instance, using the ID passed as argument.
        Parameters:
        id - annotation id to apply to the object, as string
      • EllipseAnnotation

        public EllipseAnnotation​(AnnotationId id)
        Creates a ellipse annotation to be added to an AnnotationOptions instance, using the ID passed as argument.
        Parameters:
        id - annotation id to apply to the object
      • EllipseAnnotation

        public EllipseAnnotation​(String id,
                                 IsChart chart)
        Creates a ellipse annotation to be added to an AnnotationOptions instance, using the ID passed as argument.
        The chart instance, passed as argument, must be the chart where the annotations will be applied and is used to get the whole default options in order to get the default for this object.
        Parameters:
        id - annotation id to apply to the object, as string
        chart - chart instance related to the plugin options
      • EllipseAnnotation

        public EllipseAnnotation​(AnnotationId id,
                                 IsChart chart)
        Creates a ellipse annotation to be added to an AnnotationOptions instance, using the ID passed as argument.
        The chart instance, passed as argument, must be the chart where the annotations will be applied and is used to get the whole default options in order to get the default for this object.
        Parameters:
        id - annotation id to apply to the object
        chart - chart instance related to the plugin options
    • Method Detail

      • getBackgroundColorHandler

        public org.pepstock.charba.client.annotation.BackgroundColorHandler getBackgroundColorHandler()
      • getExtendedShadowOptionsHandler

        public org.pepstock.charba.client.annotation.ExtendedShadowOptionsHandler getExtendedShadowOptionsHandler()
      • getRotationHandler

        public org.pepstock.charba.client.annotation.RotationHandler getRotationHandler()
      • getLabel

        public EllipseLabel getLabel()
        Returns the label on the ellipse.
        Returns:
        the label on the ellipse
      • getType

        public abstract AnnotationType getType()
        Returns the type of annotation.
        Returns:
        the type of annotation
      • isDisplay

        public default boolean isDisplay()
        Returns true whether the annotation should be displayed.
        Returns:
        true whether the annotation should be displayed
      • isInit

        public default boolean isInit()
        Returns true to enable the animation to the annotations when they are drawing at chart initialization.
        Returns:
        true to enable the animation to the annotations when they are drawing at chart initialization.
      • isAdjustScaleRange

        public default boolean isAdjustScaleRange()
        Returns true whether the scale range should be adjusted if this annotation is out of range.
        Returns:
        true whether the scale range should be adjusted if this annotation is out of range
      • getZ

        public default int getZ()
        Returns the property determines the drawing stack level of the box annotation element.
        All visible elements will be drawn in ascending order of `z` option, with the same "drawTime" option.
        Returns:
        the property determines the drawing stack level of the box annotation element.
        All visible elements will be drawn in ascending order of `z` option, with the same "drawTime" option.
      • getDrawTime

        public default DrawTime getDrawTime()
        Returns the draw time which defines when the annotations are drawn.
        Returns:
        the draw time which defines when the annotations are drawn
      • getDrawTimeCallback

        public default DrawTimeCallback getDrawTimeCallback()
        Returns the callback called to set the draw time which defines when the annotations are drawn.
        Returns:
        the callback called to set the draw time which defines when the annotations are drawn
      • getDisplayCallback

        public default SimpleDisplayCallback<AnnotationContext> getDisplayCallback()
        Returns the callback called to set the display options.
        Returns:
        the callback called to set the display options
      • getAdjustScaleRangeCallback

        public default AdjustScaleRangeCallback getAdjustScaleRangeCallback()
        Returns the callback called to set whether the scale range should be adjusted if this annotation is out of range.
        Returns:
        the callback called to set whether the scale range should be adjusted if this annotation is out of range
      • getZCallback

        public default ZCallback getZCallback()
        Returns the callback called to set the property determines the drawing stack level of the box annotation element.
        Returns:
        the callback called to set the property determines the drawing stack level of the box annotation element
      • getXScaleID

        public default ScaleId getXScaleID()
        Returns the ID of the X scale to bind onto.
        Returns:
        the ID of the X scale to bind onto
      • getXMaxAsString

        public default String getXMaxAsString()
        Returns the right edge of the box.
        Returns:
        the right edge of the box
      • getXMaxAsDouble

        public default double getXMaxAsDouble()
        Returns the right edge of the box.
        Returns:
        the right edge of the box
      • getXMaxAsDate

        public default Date getXMaxAsDate()
        Returns the right edge of the box.
        Returns:
        the right edge of the box
      • getXMinAsString

        public default String getXMinAsString()
        Returns the left edge of the box, in units along the x axis.
        Returns:
        the left edge of the box
      • getXMinAsDouble

        public default double getXMinAsDouble()
        Returns the left edge of the box, in units along the x axis.
        Returns:
        the left edge of the box
      • getXMinAsDate

        public default Date getXMinAsDate()
        Returns the left edge of the box, in units along the x axis.
        Returns:
        the left edge of the box
      • getYScaleID

        public default ScaleId getYScaleID()
        Returns the ID of the Y scale to bind onto.
        Returns:
        the ID of the Y scale to bind onto
      • getYMaxAsString

        public default String getYMaxAsString()
        Returns the top edge of the box in units along the y axis.
        Returns:
        the top edge of the box in units along the y axis
      • getYMaxAsDouble

        public default double getYMaxAsDouble()
        Returns the top edge of the box in units along the y axis.
        Returns:
        the top edge of the box in units along the y axis
      • getYMaxAsDate

        public default Date getYMaxAsDate()
        Returns the top edge of the box in units along the y axis.
        Returns:
        the top edge of the box in units along the y axis
      • getYMinAsString

        public default String getYMinAsString()
        Returns the bottom edge of the box.
        Returns:
        the bottom edge of the box
      • getYMinAsDouble

        public default double getYMinAsDouble()
        Returns the bottom edge of the box.
        Returns:
        the bottom edge of the box
      • getYMinAsDate

        public default Date getYMinAsDate()
        Returns the bottom edge of the box.
        Returns:
        the bottom edge of the box
      • getXMinCallback

        public default ValueCallback getXMinCallback()
        Returns the callback called to set the left edge of the box, in units along the x axis.
        Returns:
        the callback called to set the left edge of the box, in units along the x axis
      • getXMaxCallback

        public default ValueCallback getXMaxCallback()
        Returns the callback called to set the right edge of the box.
        Returns:
        the callback called to set the right edge of the box
      • getYMinCallback

        public default ValueCallback getYMinCallback()
        Returns the callback called to set the left edge of the box, in units along the x axis.
        Returns:
        the callback called to set the left edge of the box, in units along the x axis
      • getYMaxCallback

        public default ValueCallback getYMaxCallback()
        Returns the callback called to set the right edge of the box.
        Returns:
        the callback called to set the right edge of the box
      • getBeforeDrawCallback

        public default ElementHookCallback getBeforeDrawCallback()
        Returns the callback called to get the control before the annotation element drawing.
        Returns:
        the callback called to get the control before the annotation element drawing
      • getAfterDrawCallback

        public default ElementHookCallback getAfterDrawCallback()
        Returns the callback called to get the control after the annotation element drawing.
        Returns:
        the callback called to get the control after the annotation element drawing
      • getInitCallback

        public default InitCallback getInitCallback()
        Returns the callback called to get the control of animation initialization element.
        Returns:
        the callback called to get the control of animation initialization element
      • setBackgroundColor

        public default void setBackgroundColor​(IsColor backgroundColor)
        Sets the color of the background of annotation.
        Parameters:
        backgroundColor - the color of the background of annotation
      • setBackgroundColor

        public default void setBackgroundColor​(String backgroundColor)
        Sets the color of the background of annotation.
        Parameters:
        backgroundColor - the color of the background of annotation
      • getBackgroundColorAsString

        public default String getBackgroundColorAsString()
        Returns the color of the background of annotation.
        Returns:
        the color of the background of annotation
      • getBackgroundColor

        public default IsColor getBackgroundColor()
        Returns the color of the background of annotation.
        Returns:
        the color of the background of annotation
      • getBackgroundColorCallback

        public default ColorCallback<AnnotationContext> getBackgroundColorCallback()
        Returns the callback called to set the color of the background of annotation.
        Returns:
        the callback called to set the color of the background of annotation
      • setBackgroundColor

        public default void setBackgroundColor​(ColorCallback<AnnotationContext> backgroundColorCallback)
        Sets the callback to set the color of the background of annotation.
        Parameters:
        backgroundColorCallback - to set the color of the background of annotation
      • setBackgroundColor

        public default void setBackgroundColor​(NativeCallback backgroundColorCallback)
        Sets the callback to set the color of the background of annotation.
        Parameters:
        backgroundColorCallback - to set the color of the background of annotation
      • setBackgroundShadowColor

        public default void setBackgroundShadowColor​(IsColor backgroundColor)
        Sets the color of the shadow of annotation.
        Parameters:
        backgroundColor - the color of the shadow of annotation
      • setBackgroundShadowColor

        public default void setBackgroundShadowColor​(String backgroundColor)
        Sets the color of the shadow of annotation.
        Parameters:
        backgroundColor - the color of the shadow of annotation
      • getBackgroundShadowColorAsString

        public default String getBackgroundShadowColorAsString()
        Returns the color of the shadow of annotation.
        Returns:
        the color of the shadow of annotation
      • getBackgroundShadowColor

        public default IsColor getBackgroundShadowColor()
        Returns the color of the shadow of annotation.
        Returns:
        the color of the shadow of annotation
      • getBackgroundShadowColorCallback

        public default ColorCallback<AnnotationContext> getBackgroundShadowColorCallback()
        Returns the callback called to set the color of the shadow of annotation.
        Returns:
        the callback called to set the color of the shadow of annotation
      • setBackgroundShadowColor

        public default void setBackgroundShadowColor​(ColorCallback<AnnotationContext> borderShadowColorCallback)
        Sets the callback to set the color of the shadow of annotation.
        Parameters:
        borderShadowColorCallback - to set the color of the shadow of annotation
      • setBackgroundShadowColor

        public default void setBackgroundShadowColor​(NativeCallback borderShadowColorCallback)
        Sets the callback to set the color of the shadow of annotation.
        Parameters:
        borderShadowColorCallback - to set the color of the shadow of annotation
      • setRotation

        public default void setRotation​(double radius)
        Sets the rotation.
        Parameters:
        radius - the rotation.
      • getRotation

        public default double getRotation()
        Returns the rotation (in pixels).
        Returns:
        the rotation (in pixels).
      • getRotationCallback

        public default RotationCallback<AnnotationContext> getRotationCallback()
        Returns the callback called to set the rotation.
        Returns:
        the callback called to set the rotation
      • setRotation

        public default void setRotation​(RotationCallback<AnnotationContext> rotationCallback)
        Sets the callback to set the rotation.
        Parameters:
        rotationCallback - to set the rotation
      • setRotation

        public default void setRotation​(NativeCallback rotationCallback)
        Sets the callback to set the rotation.
        Parameters:
        rotationCallback - to set the rotation
      • setBorderColor

        public default void setBorderColor​(IsColor borderColor)
        Sets the color of the border of annotation.
        Parameters:
        borderColor - the color of the border of annotation
      • setBorderColor

        public default void setBorderColor​(String borderColor)
        Sets the color of the border of annotation.
        Parameters:
        borderColor - the color of the border of annotation
      • getBorderColorAsString

        public default String getBorderColorAsString()
        Returns the color of the border of annotation.
        Returns:
        the color of the border of annotation
      • getBorderColor

        public default IsColor getBorderColor()
        Returns the color of the border of annotation.
        Returns:
        the color of the border of annotation
      • setBorderWidth

        public default void setBorderWidth​(int borderWidth)
        Sets the width of the border in pixels.
        Parameters:
        borderWidth - the width of the border in pixels.
      • getBorderWidth

        public default int getBorderWidth()
        Returns the width of the border in pixels.
        Returns:
        the width of the border in pixels.
      • setBorderDash

        public default void setBorderDash​(int... borderDash)
        Sets the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
        Parameters:
        borderDash - the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
      • getBorderDash

        public default List<Integer> getBorderDash()
        Returns the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
        Returns:
        the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
      • setBorderDashOffset

        public default void setBorderDashOffset​(double borderDashOffset)
        Sets the line dash pattern offset.
        Parameters:
        borderDashOffset - the line dash pattern offset.
      • getBorderDashOffset

        public default double getBorderDashOffset()
        Returns the line dash pattern offset.
        Returns:
        the line dash pattern offset.
      • getBorderColorCallback

        public default ColorCallback<AnnotationContext> getBorderColorCallback()
        Returns the callback called to set the color of the border of annotation.
        Returns:
        the callback called to set the color of the border of annotation
      • setBorderColor

        public default void setBorderColor​(ColorCallback<AnnotationContext> borderColorCallback)
        Sets the callback to set the color of the border of annotation.
        Parameters:
        borderColorCallback - to set the color of the border of annotation
      • setBorderColor

        public default void setBorderColor​(NativeCallback borderColorCallback)
        Sets the callback to set the color of the border of annotation.
        Parameters:
        borderColorCallback - to set the color of the border of annotation
      • getBorderWidthCallback

        public default WidthCallback<AnnotationContext> getBorderWidthCallback()
        Returns the callback called to set the width of the border in pixels.
        Returns:
        the callback called to set the width of the border in pixels
      • setBorderWidth

        public default void setBorderWidth​(WidthCallback<AnnotationContext> borderWidthCallback)
        Sets the callback to set the color of the width of the border in pixels.
        Parameters:
        borderWidthCallback - to set the width of the border in pixels
      • setBorderWidth

        public default void setBorderWidth​(NativeCallback borderWidthCallback)
        Sets the callback to set the color of the width of the border in pixels.
        Parameters:
        borderWidthCallback - to set the width of the border in pixels
      • getBorderDashCallback

        public default BorderDashCallback<AnnotationContext> getBorderDashCallback()
        Returns the callback called to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
        Returns:
        the callback called to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern
      • setBorderDash

        public default void setBorderDash​(BorderDashCallback<AnnotationContext> borderDashCallback)
        Sets the callback to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
        Parameters:
        borderDashCallback - to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern
      • setBorderDash

        public default void setBorderDash​(NativeCallback borderDashCallback)
        Sets the callback to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
        Parameters:
        borderDashCallback - to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern
      • getBorderDashOffsetCallback

        public default BorderDashOffsetCallback<AnnotationContext> getBorderDashOffsetCallback()
        Returns the callback called to set the line dash pattern offset.
        Returns:
        the callback called to set the line dash pattern offset
      • setBorderDashOffset

        public default void setBorderDashOffset​(BorderDashOffsetCallback<AnnotationContext> borderDashOffsetCallback)
        Sets the callback to set the line dash pattern offset.
        Parameters:
        borderDashOffsetCallback - to set the line dash pattern offset
      • setBorderDashOffset

        public default void setBorderDashOffset​(NativeCallback borderDashOffsetCallback)
        Sets the callback to set the line dash pattern offset.
        Parameters:
        borderDashOffsetCallback - to set the line dash pattern offset
      • setBorderShadowColor

        public default void setBorderShadowColor​(IsColor borderColor)
        Sets the color of the border shadow of annotation.
        Parameters:
        borderColor - the color of the border shadow of annotation
      • setBorderShadowColor

        public default void setBorderShadowColor​(String borderColor)
        Sets the color of the border shadow of annotation.
        Parameters:
        borderColor - the color of the border shadow of annotation
      • getBorderShadowColorAsString

        public default String getBorderShadowColorAsString()
        Returns the color of the border shadow of annotation.
        Returns:
        the color of the border shadow of annotation
      • getBorderShadowColor

        public default IsColor getBorderShadowColor()
        Returns the color of the border shadow of annotation.
        Returns:
        the color of the border shadow of annotation
      • setShadowBlur

        public default void setShadowBlur​(double shadowBlur)
        Sets the amount of blur applied to shadows.
        Parameters:
        shadowBlur - the amount of blur applied to shadows
      • getShadowBlur

        public default double getShadowBlur()
        Returns the amount of blur applied to shadows.
        Returns:
        the amount of blur applied to shadows
      • setShadowOffsetX

        public default void setShadowOffsetX​(int shadowOffset)
        Sets the distance that shadows will be offset horizontally.
        Parameters:
        shadowOffset - the distance that shadows will be offset horizontally.
      • getShadowOffsetX

        public default int getShadowOffsetX()
        Returns the distance that shadows will be offset horizontally.
        Returns:
        the distance that shadows will be offset horizontally.
      • setShadowOffsetY

        public default void setShadowOffsetY​(int shadowOffset)
        Sets the distance that shadows will be offset vertically.
        Parameters:
        shadowOffset - the distance that shadows will be offset vertically.
      • getShadowOffsetY

        public default int getShadowOffsetY()
        Returns the distance that shadows will be offset vertically.
        Returns:
        the distance that shadows will be offset vertically.
      • getBorderShadowColorCallback

        public default ColorCallback<AnnotationContext> getBorderShadowColorCallback()
        Returns the callback called to set the color of the border shadow of annotation.
        Returns:
        the callback called to set the color of the border shadow of annotation
      • setBorderShadowColor

        public default void setBorderShadowColor​(ColorCallback<AnnotationContext> borderShadowColorCallback)
        Sets the callback to set the color of the border shadow of annotation.
        Parameters:
        borderShadowColorCallback - to set the color of the border shadow of annotation
      • setBorderShadowColor

        public default void setBorderShadowColor​(NativeCallback borderShadowColorCallback)
        Sets the callback to set the color of the border shadow of annotation.
        Parameters:
        borderShadowColorCallback - to set the color of the border shadow of annotation
      • getShadowBlurCallback

        public default ShadowBlurCallback getShadowBlurCallback()
        Returns the callback called to set the amount of blur applied to shadows.
        Returns:
        the callback called to set the amount of blur applied to shadows.
      • setShadowBlur

        public default void setShadowBlur​(ShadowBlurCallback shadowBlurCallback)
        Sets the callback to set the amount of blur applied to shadows.
        Parameters:
        shadowBlurCallback - to set the amount of blur applied to shadows.
      • setShadowBlur

        public default void setShadowBlur​(NativeCallback shadowBlurCallback)
        Sets the callback to set the amount of blur applied to shadows.
        Parameters:
        shadowBlurCallback - to set the amount of blur applied to shadows.
      • getShadowOffsetXCallback

        public default ShadowOffsetCallback getShadowOffsetXCallback()
        Returns the callback called to set the distance that shadows will be offset horizontally.
        Returns:
        the callback called to set the distance that shadows will be offset horizontally.
      • setShadowOffsetX

        public default void setShadowOffsetX​(ShadowOffsetCallback shadowOffsetCallback)
        Sets the callback to set the distance that shadows will be offset horizontally.
        Parameters:
        shadowOffsetCallback - to set the distance that shadows will be offset horizontally.
      • setShadowOffsetX

        public default void setShadowOffsetX​(NativeCallback shadowOffsetCallback)
        Sets the callback to set the distance that shadows will be offset horizontally.
        Parameters:
        shadowOffsetCallback - to set the distance that shadows will be offset horizontally.
      • getShadowOffsetYCallback

        public default ShadowOffsetCallback getShadowOffsetYCallback()
        Returns the callback called to set the distance that shadows will be offset vertically.
        Returns:
        the callback called to set the distance that shadows will be offset vertically.
      • setShadowOffsetY

        public default void setShadowOffsetY​(ShadowOffsetCallback shadowOffsetCallback)
        Sets the callback to set the distance that shadows will be offset vertically.
        Parameters:
        shadowOffsetCallback - to set the distance that shadows will be offset vertically.
      • setShadowOffsetY

        public default void setShadowOffsetY​(NativeCallback shadowOffsetCallback)
        Sets the callback to set the distance that shadows will be offset vertically.
        Parameters:
        shadowOffsetCallback - to set the distance that shadows will be offset vertically.
      • getEnterCallback

        public default EnterCallback getEnterCallback()
        Returns the callback called when a "enter" event is occurring.
        Returns:
        the callback called when a "enter" event is occurring
      • setEnterCallback

        public default void setEnterCallback​(EnterCallback enterCallback)
        Sets the callback called when a "enter" event is occurring.
        Parameters:
        enterCallback - the callback called when a "enter" event is occurring
      • getLeaveCallback

        public default LeaveCallback getLeaveCallback()
        Returns the callback called when a "leave" event is occurring.
        Returns:
        the callback called when a "leave" event is occurring
      • setLeaveCallback

        public default void setLeaveCallback​(LeaveCallback leaveCallback)
        Sets the callback called when a "leave" event is occurring.
        Parameters:
        leaveCallback - the callback called when a "leave" event is occurring
      • getClickCallback

        public default ClickCallback getClickCallback()
        Returns the callback called when a "click" event is occurring.
        Returns:
        the callback called when a "click" event is occurring
      • setClickCallback

        public default void setClickCallback​(ClickCallback clickCallback)
        Sets the callback called when a "click" event is occurring.
        Parameters:
        clickCallback - the callback called when a "click" event is occurring