Skip to content

Instantly share code, notes, and snippets.

@goenning
Created December 11, 2011 20:09
Show Gist options
  • Save goenning/1462473 to your computer and use it in GitHub Desktop.
Save goenning/1462473 to your computer and use it in GitHub Desktop.
Pure Highcharts ajax-enabled example
var myAjaxChart;
$(document).ready(function () {
myAjaxChart = new Highcharts.Chart({
chart: {
renderTo: 'myAjaxChart',
type: 'column'
}, title: {
text: 'Tickets per month'
}, xAxis: {
categories: ['Jan','Feb','Mar']
}, yAxis: {
title: {
text: 'Quantity'
}
}
});
setIntervalAndExecute(function(){
$.getJSON('/Ajax/LoadData', function(data) {
myAjaxChart.clearSeries();
$.each(data, function (key, value) {
myAjaxChart.addSeries({
name: value.Name,
data: value.Values
}); ;
});
});
}, 5000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment