Is there any onReady
(or similar) ready event for HighCharts?
Currently, HighCharts only offers addSeries
, click
, load
The Highcharts.Chart constructor takes a callback argument that is called "when the chart object is finished loading and rendering". The chart object is passed as an argument to the callback.
$("#the-chart").highcharts(options, function (chart) {
alert("The chart is ready now");
console.log("chart", chart);
});
Chart (Object options, Function callback) This is the constructor for creating a new chart object.
Parameters
options: Object
The chart options, as documented under the heading "The options object"in the left menu.callback: Function
A function to execute when the chart object is finished loading and rendering. In most cases the chart is built in one thread, but in Internet Explorer version 8 or lessthe chart is sometimes initiated before the document is ready, and in thesecases the chart object will not be finished directly after callingnew Highcharts.Chart(). As a consequence, code that relies on the newly built Chart object should always run in the callback. Defining a chart.event.load handler is equivalent.Returns
- Chart