Class PointAnnotation
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.annotation.AbstractAnnotation
-
- org.pepstock.charba.client.annotation.PointAnnotation
-
public final class PointAnnotation extends AbstractAnnotation
Implements a POINT annotation which draws a point in the a chart.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_BORDER_WIDTH
Default point annotation border width, 2.static double
DEFAULT_RADIUS
Default point annotation radius, 10.0.-
Fields inherited from class org.pepstock.charba.client.annotation.AbstractAnnotation
DEFAULT_ADJUST_SCALE_RANGE, DEFAULT_DISPLAY
-
-
Constructor Summary
Constructors Constructor Description PointAnnotation()
Creates a line annotation to be added to anAnnotationOptions
instance.
The annotation id is calculated automatically.PointAnnotation(String id)
Creates a line annotation to be added to anAnnotationOptions
instance, using the ID passed as argument.PointAnnotation(String id, IsChart chart)
Creates a line annotation to be added to anAnnotationOptions
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.PointAnnotation(AnnotationId id)
Creates a line annotation to be added to anAnnotationOptions
instance, using the ID passed as argument.PointAnnotation(AnnotationId id, IsChart chart)
Creates a line annotation to be added to anAnnotationOptions
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.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Default Methods Modifier and Type Method Description default AdjustScaleRangeCallback
getAdjustScaleRangeCallback()
Returns the callback called to set whether the scale range should be adjusted if this annotation is out of range.default IsColor
getBackgroundColor()
Returns the color of the background of annotation.default String
getBackgroundColorAsString()
Returns the color of the background of annotation.default ColorCallback<AnnotationContext>
getBackgroundColorCallback()
Returns the callback called to set the color of the background of annotation.org.pepstock.charba.client.annotation.BackgroundColorHandler
getBackgroundColorHandler()
default String
getBorderColorAsString()
Returns the color of the border of annotation.default ColorCallback<AnnotationContext>
getBorderColorCallback()
Returns the callback called to set the color of the border of annotation.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.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.default double
getBorderDashOffset()
Returns the line dash pattern offset.default BorderDashOffsetCallback<AnnotationContext>
getBorderDashOffsetCallback()
Returns the callback called to set the line dash pattern offset.default int
getBorderWidth()
default WidthCallback<AnnotationContext>
getBorderWidthCallback()
Returns the callback called to set the width of the border in pixels.default ClickCallback
getClickCallback()
Returns the callback called when a "click" event is occurring.default DisplayCallback<AnnotationContext>
getDisplayCallback()
Returns the callback called to set the display options.default DoubleClickCallback
getDoubleClickCallback()
Returns the callback called when a "dblclick" event is occurring.default DrawTime
getDrawTime()
Returns the draw time which defines when the annotations are drawn.default DrawTimeCallback
getDrawTimeCallback()
Returns the callback called to set the draw time which defines when the annotations are drawn.default EnterCallback
getEnterCallback()
Returns the callback called when a "enter" event is occurring.default LeaveCallback
getLeaveCallback()
Returns the callback called when a "leave" event is occurring.double
getRadius()
Returns the radius of the point.RadiusCallback<AnnotationContext>
getRadiusCallback()
Returns the callback called to set the radius.AnnotationType
getType()
Returns the type of annotation.ScaleId
getXScaleID()
Returns the ID of the X scale to bind onto.Date
getXValueAsDate()
Returns the data X value to draw the line at.double
getXValueAsDouble()
Returns the data X value to draw the line at.String
getXValueAsString()
Returns the data X value to draw the line at.ValueCallback
getXValueCallback()
Returns the callback called to set the data X value to draw the line at.ScaleId
getYScaleID()
Returns the ID of the Y scale to bind onto.Date
getYValueAsDate()
Returns the data Y value to draw the line at.double
getYValueAsDouble()
Returns the data Y value to draw the line at.String
getYValueAsString()
Returns the data Y value to draw the line at.ValueCallback
getYValueCallback()
Returns the callback called to set the data Y value to draw the line at.default boolean
isAdjustScaleRange()
Returnstrue
whether the scale range should be adjusted if this annotation is out of range.default boolean
isDisplay()
Returnstrue
whether the annotation should be displayed.default void
setBackgroundColor(String backgroundColor)
Sets the color of the background of annotation.default void
setBackgroundColor(ColorCallback<AnnotationContext> backgroundColorCallback)
Sets the callback to set the color of the background of annotation.default void
setBackgroundColor(NativeCallback backgroundColorCallback)
Sets the callback to set the color of the background of annotation.default void
setBackgroundColor(IsColor backgroundColor)
Sets the color of the background of annotation.void
setRadius(double radius)
Sets the radius of the point shape.
If set to 0, the point is not rendered.void
setRadius(NativeCallback radiusCallback)
Sets the callback to set the radius.void
setRadius(RadiusCallback<AnnotationContext> radiusCallback)
Sets the callback to set the radius.void
setXScaleID(String scaleId)
Sets the ID of the X scale to bind onto.void
setXScaleID(ScaleId scaleId)
Sets the ID of the X scale to bind onto.void
setXValue(double value)
Sets the data X value to draw the line at.void
setXValue(String value)
Sets the data X value to draw the line at.void
setXValue(Date value)
Sets the data X value to draw the line at.void
setXValue(ValueCallback valueCallback)
Sets the callback to set the data X value to draw the line at.void
setXValue(NativeCallback valueCallback)
Sets the callback to set the data X value to draw the line at.void
setYScaleID(String scaleId)
Sets the ID of the Y scale to bind onto.void
setYScaleID(ScaleId scaleId)
Sets the ID of the Y scale to bind onto.void
setYValue(double value)
Sets the data Y value to draw the line at.void
setYValue(String value)
Sets the data Y value to draw the line at.void
setYValue(Date value)
Sets the data Y value to draw the line at.void
setYValue(ValueCallback valueCallback)
Sets the callback to set the data Y value to draw the line at.void
setYValue(NativeCallback valueCallback)
Sets the callback to set the data Y value to draw the line at.-
Methods inherited from class org.pepstock.charba.client.annotation.AbstractAnnotation
getAdjustScaleRangeCallback, getBorderColor, getBorderColorCallback, getBorderDash, getBorderDashCallback, getBorderDashOffset, getBorderDashOffsetCallback, getBorderWidthCallback, getClickCallback, getDisplayCallback, getDoubleClickCallback, getDrawTime, getDrawTimeCallback, getEnterCallback, getId, getLeaveCallback, getType, isAdjustScaleRange, isDisplay, setAdjustScaleRange, setAdjustScaleRange, setAdjustScaleRange, setBorderColor, setBorderColor, setBorderColor, setBorderColor, setBorderDash, setBorderDash, setBorderDash, setBorderDashOffset, setBorderDashOffset, setBorderDashOffset, setBorderWidth, setBorderWidth, setBorderWidth, setClickCallback, setDisplay, setDisplay, setDisplay, setDoubleClickCallback, setDrawTime, setDrawTime, setDrawTime, setEnterCallback, setLeaveCallback
-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
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()
Creates a line annotation to be added to anAnnotationOptions
instance.
The annotation id is calculated automatically.- See Also:
AnnotationType.createId()
-
PointAnnotation
public PointAnnotation(String id)
Creates a line annotation to be added to anAnnotationOptions
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 anAnnotationOptions
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 anAnnotationOptions
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 stringchart
- chart instance related to the plugin options
-
PointAnnotation
public PointAnnotation(AnnotationId id, IsChart chart)
Creates a line annotation to be added to anAnnotationOptions
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 objectchart
- 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()
Returnstrue
whether the annotation should be displayed.- Returns:
true
whether the annotation should be displayed
-
isAdjustScaleRange
public default boolean isAdjustScaleRange()
Returnstrue
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
-
-