Important version information!

You are browsing a class reference for deprecated Version 2 of the JavaScript Charts.

Documentation for other versions: amCharts 4 (current) or amCharts 3.

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

Properties

PropertyTypeDefaultDescription
adjustBorderColorBooleanfalseIf this is set to true, border color instead of background color will be changed when user rolls-over the slice, graph, etc.
borderAlphaNumber1Balloon border opacity. Value range is 0 - 1.
borderColorString#FFFFFFBalloon border color.
borderThicknessNumber2Balloon border thickness.
colorString#FFFFFFColor of text in the balloon.
cornerRadiusNumber6Balloon corner radius.
fillAlphaNumber1Balloon background opacity.
fillColorString#CC0000Balloon background color. Usually balloon background color is set by the chart. Only if "adjustBorderColor" is "true" this color will be used.
fontSizeNumberSize of text in the balloon. Chart's fontSize is used by default.
horizontalPaddingNumber8Horizontal padding of the balloon.
pointerWidthNumber10The width of the pointer (arrow) "root". Only used if cornerRadius is 0.
showBulletBooleanfalseIf 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
textAlignStringmiddleText alignment, possible values "left", "middle" and "right"
textShadowColorString#000000Color of the text shadow.
verticalPaddingNumber5Vertical padding of the balloon.

Methods

NameParametersReturnsDescription
hide()Hides balloon.
setBounds(left, top, right, bottom)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(x, y)Sets coordinates the balloon should point to.
show(value)Specifies the text which should be displayed.

Events

AmBalloon class does not have any events.