Skip to content

Instantly share code, notes, and snippets.

@crtr0
Created December 3, 2012 21:02
Show Gist options
  • Save crtr0/4197996 to your computer and use it in GitHub Desktop.
Save crtr0/4197996 to your computer and use it in GitHub Desktop.
Listen for a "vote" event from socket.io and update the chart data appopriately
socket.on('vote', function(data) {
vote = parseInt(data);
index = vote - 1;
votes = chart.series[0].data[index].y;
chart.series[0].data[index].update(votes+1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment