Class AmBalloon

AmBalloon is the class which generates balloons (datatips). Balloon follows the mouse when you roll-over the pie slice/line bullet/column/etc, chart indicator of serial charts displays value balloons and category balloon. Balloon instance is created by the chart automatically and can be accessed via "balloon" property of AmChart. Chart shows/hides and sets position for every balloon automatically, so all you need to do is to change balloon appearance, if you want to.

example

var chart = new AmCharts.AmSerialChart(); // get balloon intance var balloon = chart.balloon; // set properties balloon.adjustBorderColor = true; balloon.color = "#000000"; balloon.cornerRadius = 5; balloon.fillColor = "#FFFFFF";

Index

Properties

Methods

Properties

public adjustBorderColor: boolean

If this is set to true, border color instead of background color will be changed when user rolls-over the slice, graph, etc.

public borderAlpha: number

Balloon border opacity. Value range is 0 - 1.

default

1

public borderColor: string

Balloon border color. #FFFFFF

public borderThickness: number

Balloon border thickness.

default

2

public color: string

Color of text in the balloon. #FFFFFF

public cornerRadius: number

Balloon corner radius.

default

6

public fillAlpha: number

Balloon background opacity.

default

1

public fillColor: string

Balloon background color. Usually balloon background color is set by the chart. Only if "adjustBorderColor" is "true" this color will be used. #CC0000

public fontSize: number

Size of text in the balloon. Chart's fontSize is used by default.

public horizontalPadding: number

Horizontal padding of the balloon.

default

8 3

public pointerWidth: number

The width of the pointer (arrow) "root". Only used if cornerRadius is 0.

default

10

public showBullet: boolean

If cornerRadius of a balloon is >0, showBullet is set to true for value balloons when ChartCursor is used. If you don't want the bullet near the balloon, set it to false: chart.balloon.showBullet = false

public textAlign: string

Text alignment, possible values "left", "middle" and "right" middle

public textShadowColor: string

Color of the text shadow. #000000

public verticalPadding: number

Vertical padding of the balloon.

default

5

Methods

public hide(): any

Hides balloon.

Returns

any

public setBounds(left: number, top: number, right: number, bottom: number): any

Defines a square within which the balloon should appear. Bounds are set by chart class, you don't need to call this method yourself.

Parameters

  • left: number
  • top: number
  • right: number
  • bottom: number

Returns

any

public setPosition(x: number, y: number): any

Sets coordinates the balloon should point to.

Parameters

  • x: number
  • y: number

Returns

any

public show(value: string): any

Specifies the text which should be displayed.

Parameters

  • value: string

Returns

any