Updating balloon (tool-tip) text on the fly

Sometimes you might need to add some more information to the balloon of the graph in real time, depending on the value or some other thing. AmGraph has a property, called balloonFunction which can be used for that purpose. You should create some function (method) which will receive GraphDataItem and a reference to graph itself as attributes first:

function adjustBalloonText(graphDataItem, graph){
   return "something";
}

Now, if you set graph.balloonFunction = adjustBalloonText; and test the chart, you should get "something" in the balloon no matter on which data item you will roll-over. This is not what we need, but we did it just to understand the idea. In real life most likely you will check value or some other property of the graphDataItem and return some different string. You can easily dig to the category of currently hovered item: graphDataItem.serialDataItem.category

Here is a working demo of the above described. We simply check if the value is less than 500 and add "(Little)" text to the balloon, otherwise we add "(A lot)". Note, this method should always return a string. You can use formatNumber or formatDate methods of AmCharts object to make your numbers or dates look good.