Created
December 3, 2012 21:02
-
-
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
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
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