Created
March 18, 2014 07:41
-
-
Save stanwmusic/9615286 to your computer and use it in GitHub Desktop.
A Pen by Jesús.
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
var ic = 0; | |
function getData(){ | |
var d1 = []; | |
for (var i = 0 ; i < 19 ; i += 0.1) | |
d1.push([i, Math.sin(i - ic)]); | |
if (ic==12.5) {ic=0;} else {ic = ic + 0.05;} | |
ic = Math.round(ic*100)/100; | |
return d1; | |
} | |
function update(){ | |
plot.setData([getData()]); | |
plot.draw(); | |
} | |
var plot = $.plot($("#myChart"), [ getData()]); | |
var int = self.setInterval(function(){update()},50); |
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
body | |
{ | |
background-color:#000; | |
padding:10px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
View Demo here: http://codepen.io/r1mic1b/pen/LIEir