have loading animation after data update for line chart - Javascript highcharts

Javascript examples for highcharts:Chart Data

Description

have loading animation after data update for line chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
      <script type="text/javascript">
$(function() {//w w  w  . j a  v a  2  s  .  c  o m
  $('#container').highcharts('StockChart', {
    chart: {
      events: {}
    },
    rangeSelector: {
      buttons: [{
        count: 1,
        type: 'minute',
        text: '1M'
      }, {
        count: 5,
        type: 'minute',
        text: '5M'
      }, {
        type: 'all',
        text: 'All'
      }],
      inputEnabled: false,
      selected: 0
    },
    title: {
      text: 'Live random data'
    },
    plotOptions: {
      series: {
        animation: {
          duration: 2000
        }
      }
    },
    series: [{
      name: 'Random data',
      data: newData()
    }]
  });
});
function newData() {
  var data = [],
      time = (new Date()).getTime(),
      i;
  for (i = -999; i <= 0; i += 1) {
    data.push([
      time + i * 1000,
      Math.round(Math.random() * 100)
    ]);
  }
  return data;
}

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/stock/highstock.js"></script> 
      <div id="container" style="height: 400px; min-width: 310px"></div>  
   </body>
</html>

Related Tutorials