I have a Highchart object and a function to load the data:
graficaPropuestas = new Highcharts.Chart({
chart: {
height: 300,
renderTo: "graficaPropuestas",
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
events: {
load: recogerDatosInforme('propuesta', $(this))
}
}
})
And the function to load the data:
function recogerDatosInforme(tipo, gr) {
$.ajax({
url: '/Licencia/recogerDatosUsuariosSistema?tipo' + tipo,
datatype: "json",
success: function(data) {
gr.series[0].setData(data);
},
cache: false
});
}
I want to pass the graficaPropuestas object to the function so I can reuse the same function to load more graphs, however I cant get this to work. If I put in the function directly the graficaPropuestas object on the success: method it work well.
Any help would be appreciated.