title: Play/Pause Dynamic Flot Graph
body: <p>I am very new to jQuery so any help is welcome. I have a dynamic graph made with jQuery and Flot that is pretty much the same as the following example:
  <a href="http://www.flotcharts.org/flot/examples/realtime/index.html" rel="nofollow">http://www.flotcharts.org/flot/examples/realtime/index.html</a></p>
  
  <p>The only changes I made to the code were cosmetic. However, I would like to add functionality to pause and play the updates made to the graph based on a button click. I thought adding some conditionals to the update section of code:</p>
  
  <pre><code>    function update() {
  
          plot.setData([getRandomData()]);
  
          // Since the axes don't change, we don't need to call plot.setupGrid()
  
          plot.draw();
          setTimeout(update, updateInterval);
      }
  
      update();
  </code></pre>
  
  <p>might accomplish this but I wouldn't know what functions to employ. How could I go about writing this pause/play functionality?</p>