Is there any onReady
(or similar) ready event for HighCharts?
Currently, HighCharts only offers addSeries
, click
, load
Indeed the delayed call is not a very good approach. The load
event is working properly, but the current chart is referred by the this
keyword, i.e.
// create the chart
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
events: {
load: function(event) {
//When is chart ready?
console.log(this); //this refers to the loaded chart.
}
}
},
xAxis: {
},
series: [{
animation: false,
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});
Demo
Hope this helps :)