 <p>Basically, to run function in x seconds, use <code>setTimeout</code></p> <pre><code>setInterval( function () { //do magic here every 2seconds }, 2000); </code></pre> <p>And for updating chart.js data refer to this <a href="http://stackoverflow.com/a/20100851/2308005">answer</a></p>