I need to append onload or redraw event functions dynamically in Highcharts, I know make that in config step, like:
$('#container').highcharts({
chart: {
events: {
load: function(event) {
function1();
function2();
function3();
},
redraw: function(event) {
functionA();
functionB();
functionC();
}
}
},
xAxis: {
},
series: [{
data: [29.9, 71.5]
}]
});
But I need do that after config the chart ('cause I don't have access to config chart step, the chart comes to my code by a wrapper) and I need to do something like this:
//The wrapper simulation
^
|
|
/////////////////////////////////////////
//$('#container').highcharts({ //
// chart: { //
// events: { //
// load: function(event) { //
// function1(); //
// }, //
// redraw: function(event) { //
// functionA(); //
// } //< "I dont't have access to this code"
// } //
// }, //
// xAxis: { //
// }, //
// series: [{ //
// data: [29.9, 71.5] //
// }] //
//}); //
/////////////////////////////////////////
//I only have the container id in my hands, I can get the highchart object:
$('#container').highcharts();
//And I need to do something like this:
appendOnLoadEvent(function2);
appendOnLoadEvent(function3);
appendOnRedrawEvent(functionB);
appendOnRedrawEvent(functionC);
Is this possible?