Package io.jmix.charts.model.balloon
Class Balloon
java.lang.Object
io.jmix.charts.model.AbstractChartObject
io.jmix.charts.model.balloon.Balloon
- All Implemented Interfaces:
Serializable
Creates the balloons (tooltips) of the chart, It follows the mouse cursor when you roll-over the data items.
See documentation for properties of AmBalloon JS object.
http://docs.amcharts.com/3/javascriptcharts/AmBalloon
See documentation for properties of AmBalloon JS object.
http://docs.amcharts.com/3/javascriptcharts/AmBalloon
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetColor()
getDrop()
setAdjustBorderColor
(Boolean adjustBorderColor) Set adjustBorderColor to true if you want that the border color will be changed when user rolls-over the slice, graph, etc instead of background color.setAnimationDuration
(Double animationDuration) Sets duration of balloon movement from previous point to current point, in seconds.@Max(1L) @Min(0L) Balloon
setBorderAlpha
(Double borderAlpha) Sets balloon border opacity.setBorderColor
(Color borderColor) Sets balloon border color.setBorderThickness
(Integer borderThickness) Sets balloon border thickness.Sets color of text in the balloon.setCornerRadius
(Integer cornerRadius) Sets balloon corner radius.setDisableMouseEvents
(Boolean disableMouseEvents) Set disableMouseEvents to false if your balloon has links and you want those links to be clickable.Allows having drop-shaped balloons.setEnabled
(Boolean enabled) Set enabled to false if you want to disable balloons for certain value axes.setFadeOutDuration
(Double fadeOutDuration) Sets duration of a fade out animation, in seconds.@Max(1L) @Min(0L) Balloon
setFillAlpha
(Double fillAlpha) Sets balloon background opacity.setFillColor
(Color fillColor) Sets balloon background color.setFixedPosition
(Boolean fixedPosition) Specifies if balloon should follow mouse when hovering the slice/column/bullet or stay in fixed position (this does not affect balloon behavior if ChartCursor is used).setFontSize
(Integer fontSize) Sets size of text in the balloon.setHorizontalPadding
(Integer horizontalPadding) Sets horizontal padding of the balloon.setMaxWidth
(Integer maxWidth) Sets maximum width of a balloon.setOffsetX
(Integer offsetX) Sets horizontal distance from mouse pointer to balloon pointer.setOffsetY
(Integer offsetY) Sets vertical distance from mouse pointer to balloon pointer.setPointerOrientation
(PointerOrientation pointerOrientation) Specifies direction of a pointer.setPointerWidth
(Integer pointerWidth) Specifies direction of a pointer.@Max(1L) @Min(0L) Balloon
setShadowAlpha
(Double shadowAlpha) Sets opacity of a shadow.setShadowColor
(Color shadowColor) Sets color of a shadow.setShowBullet
(Boolean showBullet) If cornerRadius of a balloon is greater than 0, showBullet is set to true for value balloons whenCursor
is used.setTextAlign
(Align textAlign) Sets text alignment, possible values "left", "middle" and "right".setVerticalPadding
(Integer verticalPadding) Sets vertical padding of the balloon.
-
Constructor Details
-
Balloon
public Balloon()
-
-
Method Details
-
getAdjustBorderColor
- Returns:
- true if border color will be changed when user rolls-over the slice, graph, etc instead of background color
-
setAdjustBorderColor
Set adjustBorderColor to true if you want that the border color will be changed when user rolls-over the slice, graph, etc instead of background color. If not set the default value is true.- Parameters:
adjustBorderColor
- adjust border color option- Returns:
- balloon
-
getAnimationDuration
- Returns:
- animation duration in seconds
-
setAnimationDuration
Sets duration of balloon movement from previous point to current point, in seconds. If not set the default value is 0.3.- Parameters:
animationDuration
- animation duration in seconds- Returns:
- balloon
-
getBorderAlpha
- Returns:
- border opacity
-
setBorderAlpha
@StudioProperty(defaultValue="1") @Max(1L) @Min(0L) public @Max(1L) @Min(0L) Balloon setBorderAlpha(Double borderAlpha) Sets balloon border opacity. Value range is 0 - 1. If not set the default value is 1.- Parameters:
borderAlpha
- border opacity- Returns:
- balloon
-
getBorderColor
- Returns:
- border color
-
setBorderColor
@StudioProperty(type=OPTIONS, defaultValue="#FFFFFF") public Balloon setBorderColor(Color borderColor) Sets balloon border color. Will only be used of adjustBorderColor is false. If not set the default value is #FFFFFF.- Parameters:
borderColor
- border color- Returns:
- balloon
-
getBorderThickness
- Returns:
- border thickness
-
setBorderThickness
Sets balloon border thickness. If not set the default value is 2.- Parameters:
borderThickness
- border thickness- Returns:
- balloon
-
getColor
- Returns:
- color of text
-
setColor
Sets color of text in the balloon. If not set the default value is #000000.- Parameters:
color
- color of the text- Returns:
- balloon
-
getCornerRadius
- Returns:
- balloon corner radius
-
setCornerRadius
Sets balloon corner radius. If not set the default value is 0.- Parameters:
cornerRadius
- corner radius- Returns:
- balloon
-
getFadeOutDuration
- Returns:
- duration of a fade out animation, in seconds
-
setFadeOutDuration
Sets duration of a fade out animation, in seconds. If not set the default value is 0.3.- Parameters:
fadeOutDuration
- duration in seconds- Returns:
- balloon
-
getFillAlpha
- Returns:
- background opacity
-
setFillAlpha
@StudioProperty(defaultValue="0.8") @Max(1L) @Min(0L) public @Max(1L) @Min(0L) Balloon setFillAlpha(Double fillAlpha) Sets balloon background opacity. If not set the default value is 0.8.- Parameters:
fillAlpha
- background opacity- Returns:
- balloon
-
getFillColor
- Returns:
- background color
-
setFillColor
Sets balloon background color. Usually balloon background color is set by the chart. Only if adjustBorderColor is true this color will be used. If not set the default value is #FFFFFF.- Parameters:
fillColor
- background color- Returns:
- balloon
-
getFixedPosition
- Returns:
- true if balloon stays in fixed position; false if follows mouse when hovering the slice/column/bullet
-
setFixedPosition
Specifies if balloon should follow mouse when hovering the slice/column/bullet or stay in fixed position (this does not affect balloon behavior if ChartCursor is used). If not set the default value is true.- Parameters:
fixedPosition
- fixed position option- Returns:
- balloon
-
getFontSize
- Returns:
- size of text in the balloon
-
setFontSize
Sets size of text in the balloon. Chart's fontSize is used by default.- Parameters:
fontSize
- font size- Returns:
- balloon
-
getHorizontalPadding
- Returns:
- horizontal padding
-
setHorizontalPadding
Sets horizontal padding of the balloon. If not set the default value is 8.- Parameters:
horizontalPadding
- horizontal padding- Returns:
- balloon
-
getMaxWidth
- Returns:
- maximum width
-
setMaxWidth
Sets maximum width of a balloon.- Parameters:
maxWidth
- maximum width- Returns:
- balloon
-
getOffsetX
- Returns:
- horizontal distance from mouse pointer to balloon pointer
-
setOffsetX
Sets horizontal distance from mouse pointer to balloon pointer. If you set it to a small value, the balloon might flicker, as mouse might lose focus on hovered object. Note, this setting is ignored unless fixedPosition is set to false or Chart Cursor is enabled. If not set the default value is 1.- Parameters:
offsetX
- horizontal distance from mouse pointer to balloon pointer- Returns:
- balloon
-
getOffsetY
- Returns:
- vertical distance from mouse pointer to balloon pointer
-
setOffsetY
Sets vertical distance from mouse pointer to balloon pointer. If you set it to a small value, the balloon might flicker, as mouse might lose focus on hovered object. Note, this setting is ignored unless fixedPosition is set to false or Chart Cursor is enabled. If not set the default value is 6.- Parameters:
offsetY
- vertical distance from mouse pointer to balloon pointer- Returns:
- balloon
-
getPointerWidth
- Returns:
- pointer width
-
setPointerWidth
Specifies direction of a pointer. Works only if balloon drop set to true. If not set the default value is 6.- Parameters:
pointerWidth
- pointer width- Returns:
- balloon
-
getShadowAlpha
- Returns:
- opacity of a shadow
-
setShadowAlpha
@StudioProperty(defaultValue="0.4") @Max(1L) @Min(0L) public @Max(1L) @Min(0L) Balloon setShadowAlpha(Double shadowAlpha) Sets opacity of a shadow. If not set the default value is 0.4.- Parameters:
shadowAlpha
- opacity of a shadow- Returns:
- balloon
-
getShadowColor
- Returns:
- shadow color
-
setShadowColor
@StudioProperty(type=OPTIONS, defaultValue="#000000") public Balloon setShadowColor(Color shadowColor) Sets color of a shadow. If not set the default value is #000000.- Parameters:
shadowColor
- shadow color- Returns:
- balloon
-
getShowBullet
- Returns:
- true if showBullet is enabled
-
setShowBullet
If cornerRadius of a balloon is greater than 0, showBullet is set to true for value balloons whenCursor
is used. If you don't want the bullet near the balloon, set it to false. If not set the default value is false.- Parameters:
showBullet
- show bullet option- Returns:
- balloon
-
getTextAlign
- Returns:
- text alignment
-
setTextAlign
@StudioProperty(type=ENUMERATION, defaultValue="CENTER") public Balloon setTextAlign(Align textAlign) Sets text alignment, possible values "left", "middle" and "right". If not set the default value is CENTER.- Parameters:
textAlign
- text alignment- Returns:
- balloon
-
getVerticalPadding
- Returns:
- vertical padding
-
setVerticalPadding
Sets vertical padding of the balloon. If not set the default value is 4.- Parameters:
verticalPadding
- vertical padding- Returns:
- balloon
-
getDisableMouseEvents
- Returns:
- true if links in the balloon text is not clickable
-
setDisableMouseEvents
@StudioProperty(defaultValue="true") public Balloon setDisableMouseEvents(Boolean disableMouseEvents) Set disableMouseEvents to false if your balloon has links and you want those links to be clickable. If not set the default value is true.- Parameters:
disableMouseEvents
- disable mouse eventes option- Returns:
- balloon
-
getDrop
- Returns:
- true if drop is enabled
-
setDrop
Allows having drop-shaped balloons. Note, these balloons will not check for overlapping with other balloons, or if they go outside plot area. It also does not change pointer orientation automatically based on its vertical position like regular balloons do. You can use pointerOrientation property if you want it to point to different direction. Not supported by IE8. If not set the default value is false.- Parameters:
drop
- drop option- Returns:
- balloon
-
getEnabled
- Returns:
- true if balloons are enabled for certain value axes
-
setEnabled
Set enabled to false if you want to disable balloons for certain value axes. If not set the default value is true.- Parameters:
enabled
- enabled option- Returns:
- balloon
-
getPointerOrientation
- Returns:
- pointer orientation
-
setPointerOrientation
@StudioProperty(type=ENUMERATION, defaultValue="DOWN") public Balloon setPointerOrientation(PointerOrientation pointerOrientation) Specifies direction of a pointer. Works only ifdrop
set to true. If not set the default value is DOWN.- Parameters:
pointerOrientation
- pointer orientation- Returns:
- balloon
-