title: How plot json data
body: <p>I'm getting every 4 secs a json data like this:</p>
  
  <pre><code>{
     "time": "04:49:07 AM",
     "milliseconds_since_epoch": 1375246147254,
     "date": "07-31-2013"
  }
  </code></pre>
  
  <p>I'm processing it in order to get a array like this:</p>
  
  <blockquote>
    <p>[[1375230673948, 0.6443498175195954]]</p>
  </blockquote>
  
  <p>(The first data is a js timestamp)</p>
  
  <p>I'm trying to plot these data, on real time using flot:</p>
  
  <pre><code>function draw() {
      console.log('draw called');
      this.array = getTimeArray();
      $.plot(
      $("#placeholder"), [
          {
          label: "test Data",
          data: this.array,
          lines: {
              show: true,
              fill: true,
              fillColor: "rgba(249, 28, 61,0.3)",
              lineWidth: 2.5
          },
          }
      ], {
          xaxis: {
              mode: "time",
              timeformat: "%H:%M"
          },
          yaxis: {
              min: -2
          }
      });
  }
  
  function getTimeArray(flg) {
  
      var array = [],
      d = new Date(),
      tz = d.getTimezoneOffset();
      jsonUrl = 'http://date.jsontest.com/'
      var array2 = []
      $.getJSON(jsonUrl, function(data) {
          var i = 0;
              $.each(data, function(key, val) {
                  if (typeof val === 'number'){
                      d = new Date(val - 5 * 60 * 1000);
                      array2.push([d.getTime()- tz*60*1000,Math.random()]);
                      console.log(array2)
                      i++;
                  }
              });
       });
  
      for (var i = 9; i &gt;= 0; i--) {
          d = new Date(d.getTime() - 5 * 60 * 1000);
          array.push([d.getTime() - tz*60*1000, Math.random()]);
      }
      return array;
  }
  
  draw();
  setInterval(draw, 4000);
  </code></pre>
  
  <p><a href="http://jsfiddle.net/gKRPX/28/" rel="nofollow">http://jsfiddle.net/gKRPX/28/</a></p>
  
  <p>But I can't get it yet, please could somebody help me?</p>
  
  <p>I need plot the time series with their values getting the data from 
  json.Maybe using another lib it could be reached more easily, any help are welcome..</p>