title: getJSON data for updating chart
body: <blockquote>
  <p>Example of working chat:
  <a href="http://www.highcharts.com/demo/dynamic-update/gray" rel="nofollow noreferrer">http://www.highcharts.com/demo/dynamic-update/gray</a></p>
  </blockquote>
  <p>I am trying to get the above working except with the modification where the above chart is populated with random data; I wish to use <code>$.getJSON</code> command to pull data from a non domain database and insert it into the chat.</p>
  <p>So far I am able to load in the initial data so that it can create a static chart. To make it static i have had to comment out the contents of <code>setInterval()</code>.</p>
  <p>When I include <code>setInterval()</code> with some static data I get an error on the JavaScript Console in Google Chrome (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>J</kbd>).</p>
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
          &lt;title&gt;Highcharts Example&lt;/title&gt;
  
          &lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js&quot;&gt;&lt;/script&gt;
          &lt;script type=&quot;text/javascript&quot; src=&quot;date.js&quot;&gt;&lt;/script&gt;
          &lt;script type=&quot;text/javascript&quot;&gt;
  
          
  
          
          
  $(function () {
      $(document).ready(function() {
          Highcharts.setOptions({
              global: {
                  useUTC: false
              }
          });
      
      
                      
                      var jsonUrl = &quot;http://www.somewebsite.co.uk/jsonusv.php?callback=?&quot;;                    
                      $.getJSON(jsonUrl,{lastdatetime: &quot;&quot;,},function(zippy){                  
                          for (i=0; i&lt;zippy.cpmdata.length; i++){
                                  console.log(&quot;TIMESTAMP: &quot;+zippy.cpmdata[i].timestamp+&quot; AFTER: &quot;);
                                  zippy.cpmdata[i].timestamp =  Date.parse(zippy.cpmdata[i].timestamp).getTime(); 
                                  
                                  //var unixtime  Date.parse(temptime).getTime()/1000
                                  console.log(&quot; TESST &quot;+zippy.cpmdata[i].timestamp+&quot; \r\n&quot;);                              
                                  console.log(&quot; TESST zippy &quot;+zippy.cpmdata[i].timestamp+&quot; \r\n&quot;);
                                  
                                  
                                  
                                  
                                  
                                  
                                  
          var chart;
          chart = new Highcharts.Chart({
              chart: {
                  renderTo: 'container',
                  type: 'spline',
                  marginRight: 10,
                  events: {
                      load: function() {
      
                          // set up the updating of the chart each second
                          
                          var series = this.series[0];
                          var tttt = &quot;2012-11-13 17:17:00&quot;;
                          setInterval(function() { var x = Date.parse(tttt).getTime(),y = 8;
                          series.addPoint([x, y], true, true);
                          }, 5000);
                      }
                  }
              },
              title: {
                  text: 'Online Counter'
              },
              xAxis: {
                  type: 'datetime',
                  tickPixelInterval: 150
              },
              yAxis: {
                  title: {
                      text: 'units/h'
                  },
                  plotLines: [{
                      value: 0,
                      width: 1,
                      color: '#808080'
                  }]
              },
              tooltip: {
                  formatter: function() {
                          return '&lt;b&gt;'+ this.series.name +'&lt;/b&gt;&lt;br/&gt;'+
                          Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) +'&lt;br/&gt;'+
                          Highcharts.numberFormat(this.y, 2)+&quot; uSv/h&quot;;
                  }
              },
              legend: {
                  enabled: false
              },
              exporting: {
                  enabled: false
              },
              series: [{
                  name: 'units/h ',
                  data: (function() {
                      // generate an array of random data
                      var data = [],
                          time = (new Date()).getTime(),
                          i;
                      
                      
                      console.log(&quot; =============== \r\n&quot;);
                      console.log(&quot; FINAL &quot;+zippy.cpmdata[5].timestamp+&quot; \r\n&quot;);
                      
                      for (i=0; i&lt;zippy.cpmdata.length; i++){
                              data.push({
                              x: zippy.cpmdata[i].timestamp,
                              y: parseInt(zippy.cpmdata[i].cpm,10)
                              });
                          }
                      
                      return data;
                  })()
              }]
          });                             
                                  
      
                              }  });
                      console.log(&quot;==END==&quot;);                     
      });
      
  });
  
          &lt;/script&gt;
          
  
  
      &lt;/head&gt;
      &lt;body&gt;
  &lt;script src=&quot;./js/highcharts.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;./js/modules/exporting.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;gray.js&quot;&gt;&lt;/script&gt; 
  
  &lt;div id=&quot;container&quot; style=&quot;min-width: 400px; height: 400px; margin: 0 auto&quot;&gt;&lt;/div&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>I keep getting and error:</p>
  <blockquote>
  <p><strong>Uncaught Error: NOT_FOUND_ERR: DOM
  Exception 8 highcharts.js:167</strong></p>
  </blockquote>
  <p>I don't know why?</p>
  <p>A second question is due to the asynchronous nature of <code>$.getJSON</code> can I
  use the same method to get data as the original <code>$.getJSON</code> but call it in
  the <code>setInterval()</code> call to update the data dynamical.</p>