I like to draw multiple charts on one page with using the same options but with different json data for each chart. I like to do this with as little code as possible, I really need to omit code duplication.
Here is the example of the first chart:
$(function() {
$.getJSON('login.php', function(data) {
var options= {
chart : {
renderTo : 'container'
},
rangeSelector : {
enabled:false
},
series : data
};
var chart = new Highcharts.StockChart(options);
});
});
How could I use this above code to create multiple charts using different getJSON data?