lundi 2 février 2015

AmChart - addTitle not defined


I'm trying to build some charts using AmCharts, and I need to set the titles dynamically. According to the docs, each chart should have an addTitle() method:


http://ift.tt/1wZ9NU1



addTitle(text, size, color, alpha, bold)
text - text of a title size - font size color - title color alpha - title opacity bold - boolean value indicating if title should be bold.
Adds title to the top of the chart. Pie, Radar positions are updated so that they won't overlap. Plot area of Serial/XY chart is also updated unless autoMargins property is set to false. You can add any number of titles - each of them will be placed in a new line. To remove titles, simply clear titles array: chart.titles = []; and call chart.validateNow() method.


I can see no such method. I'm creating the chart using AmCharts.makeChart(), passing a div and a chart definition object:



var chart = AmCharts.makeChart($chartDiv[0], chartDefinition);


When I examine my chart object, I can see the array of titles I've included in my chartDefinition, but there's no addTitle() method defined on it.





Aucun commentaire:

Enregistrer un commentaire