Skip to content

AmBalloon

Type class

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. For example:

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";```

Sources

This information about AmBalloon is provided for reference only and is not available through exported packages and thus should not be imported or used on its own.

Inheritance

AmBalloon does not extend any other symbol.

AmBalloon is not extended by any other symbol.

Properties

adjustBorderColor

Type booleanDefault false

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

borderAlpha

Type numberDefault 1

Balloon border opacity. Value range is 0 - 1.

borderColor

Type stringDefault #FFFFFF

Balloon border color.

borderThickness

Type numberDefault 2

Balloon border thickness.

color

Type stringDefault #FFFFFF

Color of text in the balloon.

cornerRadius

Type numberDefault 6

Balloon corner radius.

fillAlpha

Type numberDefault 1

Balloon background opacity.

fillColor

Type stringDefault #CC0000

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

fontSize

Type number

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

horizontalPadding

Type numberDefault 8

Horizontal padding of the balloon.

pointerWidth

Type numberDefault 10

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

showBullet

Type booleanDefault false

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

textAlign

Type stringDefault middle

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

textShadowColor

Type stringDefault #000000

Color of the text shadow.

verticalPadding

Type numberDefault 5

Vertical padding of the balloon.

Methods

hide()

Returns void

Hides balloon.

setBounds()

Returns void

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

setPosition()

Returns void

Sets coordinates the balloon should point to.

show()

Returns void

Specifies the text which should be displayed.

Events

AmBalloon does not have any events.