title: How to update highchart every minute
body: <p>My data is coming from MYSQL Database which is getting live data. I am not using json or php.I want it to start updating every minute from 9 am till 5pm. I have tried methods like setInterval and setTimeout and chart.redraw() but cant seem to make it work. I have also tried the dynamic update chart in highcharts link is here
  <a href="https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/stock/demo/dynamic-update" rel="nofollow noreferrer">https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/stock/demo/dynamic-update</a> but cant seem to convert random data syntax to my database data. my code is :</p>
  <pre><code>
  &lt;head&gt;
      &lt;script src=&quot;https://code.highcharts.com/stock/highstock.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;https://code.highcharts.com/modules/exporting.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;https://code.highcharts.com/modules/export-data.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;https://code.highcharts.com/modules/accessibility.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;https://code.highcharts.com/stock/modules/drag-panes.js&quot;&gt;&lt;/script&gt;
      &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/public/oi chart.css&quot;&gt;
  
  &lt;/head&gt;
  &lt;figure class=&quot;highcharts-figure&quot;&gt;
      &lt;div id=&quot;container&quot;&gt;&lt;/div&gt;
  &lt;/figure&gt;
  
  &lt;script type=&quot;text/javascript&quot;&gt;
    
      Highcharts.stockChart('container', {
          chart: {
              height: (1 / 2 * 100) + '%' // 1:2 ratio
          },
          rangeSelector: {
              enabled: true,
              selected: customRange,
              buttons: [{
                  type: 'day',
                  count: 1,
                  text: '1D'
              }, {
                  type: 'week',
                  count: 1,
                  text: '1W'
              }, {
                  type: 'week',
                  count: 2,
                  text: '2W'
              }, {
                  type: 'month',
                  count: 1,
                  text: '1M'
              }, {
                  type: 'all',
                  text: 'All'
              }]
          },
          time: {
              timezoneOffset: timezone
          },
          title: {
              text: chartTitle,
  
          },
          subtitle: {
              text: subTitle,
          },
          yAxis: {
              offset: 60,
              title: {
                  text: 'Open Interest'
              },
              resize: {
                  enabled: true
              }
          },
          xAxis: {
              type: 'datetime'
          },
  
          legend: {
              layout: 'vertical',
              align: 'right',
              verticalAlign: 'middle'
          },
  
          plotOptions: {
              series: {
  
  
                  marker: {
                      enabled: false
                  },
                  label: {
                      connectorAllowed: false
                  },
  
              }
          },
  
          series: [{
              name: 'Expected',
              data: [&lt;% for(var i=0; i &lt; expected_data.length; i++) { %&gt; [&lt;%= expected_data[i] %&gt;], &lt;% } %&gt;].sort()
  
          }, {
              name: 'Actual',
              data: [&lt;% for(var i=0; i &lt; actual_data.length; i++) { %&gt; [&lt;%= actual_data[i] %&gt;], &lt;% } %&gt;].sort()
  
          }],
  
  
          responsive: {
              rules: [{
                  condition: {
                      maxWidth: 500
                  },
                  chartOptions: {
                      legend: {
                          layout: 'horizontal',
                          align: 'center',
                          verticalAlign: 'bottom'
                      }
                  }
              }]
          }
  
      });
  &lt;/script&gt;
  
  &lt;/html&gt;```
  </code></pre>