Class Balloon

java.lang.Object
io.jmix.charts.model.AbstractChartObject
io.jmix.charts.model.balloon.Balloon
All Implemented Interfaces:
Serializable

public class Balloon extends AbstractChartObject
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 Also:
  • Constructor Details

    • Balloon

      public Balloon()
  • Method Details

    • getAdjustBorderColor

      public Boolean getAdjustBorderColor()
      Returns:
      true if border color will be changed when user rolls-over the slice, graph, etc instead of background color
    • setAdjustBorderColor

      @StudioProperty(defaultValue="true") public Balloon 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. If not set the default value is true.
      Parameters:
      adjustBorderColor - adjust border color option
      Returns:
      balloon
    • getAnimationDuration

      public Double getAnimationDuration()
      Returns:
      animation duration in seconds
    • setAnimationDuration

      @StudioProperty(defaultValue="0.3") public Balloon setAnimationDuration(Double animationDuration)
      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

      public Double 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

      public Color 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

      public Integer getBorderThickness()
      Returns:
      border thickness
    • setBorderThickness

      @StudioProperty(defaultValue="2") public Balloon setBorderThickness(Integer borderThickness)
      Sets balloon border thickness. If not set the default value is 2.
      Parameters:
      borderThickness - border thickness
      Returns:
      balloon
    • getColor

      public Color getColor()
      Returns:
      color of text
    • setColor

      @StudioProperty(type=OPTIONS, defaultValue="#000000") public Balloon setColor(Color color)
      Sets color of text in the balloon. If not set the default value is #000000.
      Parameters:
      color - color of the text
      Returns:
      balloon
    • getCornerRadius

      public Integer getCornerRadius()
      Returns:
      balloon corner radius
    • setCornerRadius

      @StudioProperty(defaultValue="0") public Balloon setCornerRadius(Integer cornerRadius)
      Sets balloon corner radius. If not set the default value is 0.
      Parameters:
      cornerRadius - corner radius
      Returns:
      balloon
    • getFadeOutDuration

      public Double getFadeOutDuration()
      Returns:
      duration of a fade out animation, in seconds
    • setFadeOutDuration

      @StudioProperty(defaultValue="0.3") public Balloon setFadeOutDuration(Double fadeOutDuration)
      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

      public Double 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

      public Color getFillColor()
      Returns:
      background color
    • setFillColor

      @StudioProperty(type=OPTIONS, defaultValue="#FFFFFF") public Balloon setFillColor(Color fillColor)
      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

      public Boolean getFixedPosition()
      Returns:
      true if balloon stays in fixed position; false if follows mouse when hovering the slice/column/bullet
    • setFixedPosition

      @StudioProperty(defaultValue="true") public Balloon 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). If not set the default value is true.
      Parameters:
      fixedPosition - fixed position option
      Returns:
      balloon
    • getFontSize

      public Integer getFontSize()
      Returns:
      size of text in the balloon
    • setFontSize

      @StudioProperty public Balloon setFontSize(Integer fontSize)
      Sets size of text in the balloon. Chart's fontSize is used by default.
      Parameters:
      fontSize - font size
      Returns:
      balloon
    • getHorizontalPadding

      public Integer getHorizontalPadding()
      Returns:
      horizontal padding
    • setHorizontalPadding

      @StudioProperty(defaultValue="8") public Balloon setHorizontalPadding(Integer horizontalPadding)
      Sets horizontal padding of the balloon. If not set the default value is 8.
      Parameters:
      horizontalPadding - horizontal padding
      Returns:
      balloon
    • getMaxWidth

      public Integer getMaxWidth()
      Returns:
      maximum width
    • setMaxWidth

      @StudioProperty public Balloon setMaxWidth(Integer maxWidth)
      Sets maximum width of a balloon.
      Parameters:
      maxWidth - maximum width
      Returns:
      balloon
    • getOffsetX

      public Integer getOffsetX()
      Returns:
      horizontal distance from mouse pointer to balloon pointer
    • setOffsetX

      @StudioProperty(defaultValue="1") public Balloon setOffsetX(Integer offsetX)
      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

      public Integer getOffsetY()
      Returns:
      vertical distance from mouse pointer to balloon pointer
    • setOffsetY

      @StudioProperty(defaultValue="6") public Balloon setOffsetY(Integer offsetY)
      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

      public Integer getPointerWidth()
      Returns:
      pointer width
    • setPointerWidth

      @StudioProperty(defaultValue="6") public Balloon setPointerWidth(Integer pointerWidth)
      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

      public Double 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

      public Color 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

      public Boolean getShowBullet()
      Returns:
      true if showBullet is enabled
    • setShowBullet

      @StudioProperty(defaultValue="false") public Balloon setShowBullet(Boolean showBullet)
      If cornerRadius of a balloon is greater than 0, showBullet is set to true for value balloons when Cursor 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

      public Align 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

      public Integer getVerticalPadding()
      Returns:
      vertical padding
    • setVerticalPadding

      @StudioProperty(defaultValue="4") public Balloon setVerticalPadding(Integer verticalPadding)
      Sets vertical padding of the balloon. If not set the default value is 4.
      Parameters:
      verticalPadding - vertical padding
      Returns:
      balloon
    • getDisableMouseEvents

      public Boolean 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

      public Boolean getDrop()
      Returns:
      true if drop is enabled
    • setDrop

      @StudioProperty(defaultValue="false") public Balloon setDrop(Boolean drop)
      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

      public Boolean getEnabled()
      Returns:
      true if balloons are enabled for certain value axes
    • setEnabled

      @StudioProperty(defaultValue="true") public Balloon setEnabled(Boolean enabled)
      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

      public PointerOrientation getPointerOrientation()
      Returns:
      pointer orientation
    • setPointerOrientation

      @StudioProperty(type=ENUMERATION, defaultValue="DOWN") public Balloon setPointerOrientation(PointerOrientation pointerOrientation)
      Specifies direction of a pointer. Works only if drop set to true. If not set the default value is DOWN.
      Parameters:
      pointerOrientation - pointer orientation
      Returns:
      balloon