Skip to content

Instantly share code, notes, and snippets.

@sgoel
Created December 29, 2011 07:09
Show Gist options
  • Save sgoel/1532509 to your computer and use it in GitHub Desktop.
Save sgoel/1532509 to your computer and use it in GitHub Desktop.
HighCharts Function
function drawChart() {
var options = {
chart: {
renderTo: 'chart',
},
series: []
};
$.getJSON('path/to/data', function(data) {
options.series = data.series;
options.xAxis.categories = data.categories;
var chart = new Highcharts.Chart(options);
}).error(function() {console.log('ajax error');});
};
$(function() {
drawChart();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment