Created
December 29, 2011 07:09
-
-
Save sgoel/1532509 to your computer and use it in GitHub Desktop.
HighCharts Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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