Class PointAnnotation


  • public final class PointAnnotation
    extends AbstractAnnotation
    Implements a POINT annotation which draws a point in the a chart.
    Author:
    Andrea "Stock" Stocchero
    • Field Detail

      • DEFAULT_BORDER_WIDTH

        public static final int DEFAULT_BORDER_WIDTH
        Default point annotation border width, 2.
        See Also:
        Constant Field Values
      • DEFAULT_RADIUS

        public static final double DEFAULT_RADIUS
        Default point annotation radius, 10.0.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PointAnnotation

        public PointAnnotation​(String id)
        Creates a line 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
      • PointAnnotation

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

        public PointAnnotation​(String id,
                               IsChart chart)
        Creates a line 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
      • PointAnnotation

        public PointAnnotation​(AnnotationId id,
                               IsChart chart)
        Creates a line 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()
      • setRadius

        public void setRadius​(double radius)
        Sets the radius of the point shape.
        If set to 0, the point is not rendered.
        Parameters:
        radius - array of the radius of the point shape.
      • getRadius

        public double getRadius()
        Returns the radius of the point.
        Returns:
        the radius of the point.
      • setYScaleID

        public void setYScaleID​(String scaleId)
        Sets the ID of the Y scale to bind onto.
        Parameters:
        scaleId - the ID of the Y scale to bind onto
      • setYScaleID

        public void setYScaleID​(ScaleId scaleId)
        Sets the ID of the Y scale to bind onto.
        Parameters:
        scaleId - the ID of the Y scale to bind onto
      • getYScaleID

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

        public void setXScaleID​(String scaleId)
        Sets the ID of the X scale to bind onto.
        Parameters:
        scaleId - the ID of the X scale to bind onto
      • setXScaleID

        public void setXScaleID​(ScaleId scaleId)
        Sets the ID of the X scale to bind onto.
        Parameters:
        scaleId - the ID of the X scale to bind onto
      • getXScaleID

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

        public void setXValue​(String value)
        Sets the data X value to draw the line at.
        Parameters:
        value - the data X value to draw the line at
      • setXValue

        public void setXValue​(double value)
        Sets the data X value to draw the line at.
        Parameters:
        value - the data X value to draw the line at
      • setXValue

        public void setXValue​(Date value)
        Sets the data X value to draw the line at.
        Parameters:
        value - the data X value to draw the line at
      • getXValueAsString

        public String getXValueAsString()
        Returns the data X value to draw the line at.
        Returns:
        the data X value to draw the line at
      • getXValueAsDouble

        public double getXValueAsDouble()
        Returns the data X value to draw the line at.
        Returns:
        the data X value to draw the line at
      • getXValueAsDate

        public Date getXValueAsDate()
        Returns the data X value to draw the line at.
        Returns:
        the data X value to draw the line at
      • setYValue

        public void setYValue​(String value)
        Sets the data Y value to draw the line at.
        Parameters:
        value - the data Y value to draw the line at
      • setYValue

        public void setYValue​(double value)
        Sets the data Y value to draw the line at.
        Parameters:
        value - the data Y value to draw the line at
      • setYValue

        public void setYValue​(Date value)
        Sets the data Y value to draw the line at.
        Parameters:
        value - the data Y value to draw the line at
      • getYValueAsString

        public String getYValueAsString()
        Returns the data Y value to draw the line at.
        Returns:
        the data Y value to draw the line at
      • getYValueAsDouble

        public double getYValueAsDouble()
        Returns the data Y value to draw the line at.
        Returns:
        the data Y value to draw the line at
      • getYValueAsDate

        public Date getYValueAsDate()
        Returns the data Y value to draw the line at.
        Returns:
        the data Y value to draw the line at
      • getRadiusCallback

        public RadiusCallback<AnnotationContext> getRadiusCallback()
        Returns the callback called to set the radius.
        Returns:
        the callback called to set the radius
      • setRadius

        public void setRadius​(RadiusCallback<AnnotationContext> radiusCallback)
        Sets the callback to set the radius.
        Parameters:
        radiusCallback - to set the radius
      • setRadius

        public void setRadius​(NativeCallback radiusCallback)
        Sets the callback to set the radius.
        Parameters:
        radiusCallback - to set the radius
      • getXValueCallback

        public ValueCallback getXValueCallback()
        Returns the callback called to set the data X value to draw the line at.
        Returns:
        the callback called to set the data X value to draw the line at
      • setXValue

        public void setXValue​(ValueCallback valueCallback)
        Sets the callback to set the data X value to draw the line at.
        Parameters:
        valueCallback - to set the data X value to draw the line at
      • setXValue

        public void setXValue​(NativeCallback valueCallback)
        Sets the callback to set the data X value to draw the line at.
        Parameters:
        valueCallback - to set the data X value to draw the line at
      • getYValueCallback

        public ValueCallback getYValueCallback()
        Returns the callback called to set the data Y value to draw the line at.
        Returns:
        the callback called to set the data Y value to draw the line at
      • setYValue

        public void setYValue​(ValueCallback valueCallback)
        Sets the callback to set the data Y value to draw the line at.
        Parameters:
        valueCallback - to set the data Y value to draw the line at
      • setYValue

        public void setYValue​(NativeCallback valueCallback)
        Sets the callback to set the data Y value to draw the line at.
        Parameters:
        valueCallback - to set the data Y value to draw the line at
      • getBorderWidth

        public default int getBorderWidth()
      • 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
      • 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
      • 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
      • getBorderColorAsString

        public default String getBorderColorAsString()
        Returns the color of the border of annotation.
        Returns:
        the color of the border of annotation
      • 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
      • getBorderDashOffset

        public default double getBorderDashOffset()
        Returns the line dash pattern offset.
        Returns:
        the line dash pattern offset
      • 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
      • 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
      • 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
      • getDoubleClickCallback

        public default DoubleClickCallback getDoubleClickCallback()
        Returns the callback called when a "dblclick" event is occurring.
        Returns:
        the callback called when a "dblclick" event is occurring
      • 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 DisplayCallback<AnnotationContext> getDisplayCallback()
        Returns the callback called to set the display options.
        Returns:
        the callback called to set the display options
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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