You can attach event listeners with the chart.events.on() method:
chart.events.on("Resize", function({width:500, height:500}){
console.log("The size of the chart has changed");
});
The names of events are case-insensitive.
To detach events, use the chart.events.detach() method:
chart.events.on("Resize", function({width:500, height:500}){
console.log("The size of the chart has changed");
});
chart.events.detach("Resize");
To call events, use the chart.events.fire() method:
chart.events.fire("name",args);
// where args is an array of arguments
The full list of events is available in the related API section.
Back to top