title: Highcharts, show total data as a live stream
body: <p>What I am trying to do is quite interesting but I am struggling to proceed with my thought:</p>
  
  <p><strong>What I have done:</strong></p>
  
  <p>I have a CSV file containing 100 datasets. These datasets are points which I plot on the Y-axis.</p>
  
  <p>All the 100 points are plotting as expected on the HighCharts graph as I show you in the following figure:</p>
  
  <p><a href="https://i.stack.imgur.com/YsAwQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YsAwQ.png" alt="Highchart&#39;s data of 100 points"></a></p>
  
  <p><strong>Code:</strong></p>
  
  <p>The following is the code I used to get the above result:</p>
  
  <pre class="lang-js prettyprint-override"><code>$.get('abc.csv', function(data) {
      var lines = []
      lines = data.split('\n');
      var ppgData=[];
  
      $.each(lines, function(ppgNo, ppgContent) {
          if (ppgNo &gt;= 0) {
              ppgData[ppgNo - 0] = parseFloat(ppgContent.substring(ppgContent.lastIndexOf(',') + 1));
          }
      });
  
      Highcharts.chart('ppg', {
          chart: {
              type: 'line'
          },
          title: {
              text: 'ECG Data'
          },
          subtitle: {
              text: ''
          },
          xAxis: {
              crosshair: false
          },
          yAxis: {
              title: {
                  text: 'ECG Peaks'
              }
          },
          tooltip: {
              enable: false
          },
          plotOptions: {
              column: {
                  pointPadding: 0.2,
                  borderWidth: 0
              }
          },
          series: [{
              name: '',
              lineWidth: 1,
              data: ppgData,
              animation: {
                  duration: 15000
              }
          }]
      });
  });
  </code></pre>
  
  <p><strong>What I want to achieve:</strong></p>
  
  <ol>
  <li><p>I want to show only the first 10 points on the graph.</p></li>
  <li><p>I want to show the other data in 10 10 patches but in the same graph by removing the last 10 plots until I reach all the 100 points.</p></li>
  </ol>
  
  <p>Is this possible in Highcharts using JavaScript? If so then please suggest how I might do so?</p>
  
  <p>Any help is really appreciated thanks.</p>
  
  <p>Here is the working JS fiddle.</p>
  
  <p><a href="https://jsfiddle.net/abnitchauhan/3vj2afnt/" rel="nofollow noreferrer">https://jsfiddle.net/abnitchauhan/3vj2afnt/</a></p>