title: ng2-nvd3 realtime line chart update
body: <p>I just struggling with realtime line chart update in ng2-nvd3,  my data sets is fine but no changes in chart when data is coming relatime.   </p>
  
  <p>please find the solution, your help will be appreciated. </p>
  
  <p>This is my Html code </p>
  
  <pre><code>    &lt;nvd3[options]="options"[data] = "data" &gt; &lt;/nvd3&gt;
  </code></pre>
  
  <p>Its my Javascript code     </p>
  
  <pre><code>export class AppComponent implements OnInit {
      options;
      data;
      chartType;
  
      ngOnInit() {
  
          this.options = {
              chart: {
                  type: 'lineChart',
                  height: 450,
                  margin: {
                      top: 20,
                      right: 20,
                      bottom: 40,
                      left: 55
                  },
                  x: function (d) { return d.x; },
                  y: function (d) { return d.y; },
                  useInteractiveGuideline: true,
                  xAxis: {
                      axisLabel: 'Time (ms)'
                  },
                  yAxis: {
                      axisLabel: 'Voltage (v)',
                      tickFormat: function (d) {
                          return d3.format('.02f')(d);
                      },
                      axisLabelDistance: -10
                  }
              }
          };
  
          this.sinAndCos();
      }
  
  
      sinAndCos() {
          var sin = [], sin2 = [],
              cos = [];
  
          //Data is represented as an array of {x,y} pairs.
          for (var i = 0; i &lt; 100; i++) {
              sin.push({ x: i, y: Math.sin(i / 10) });
          }
  
          //Line chart data should be sent as an array of series objects.
          this.data = [
              {
                  values: sin,      //values - represents the array of {x,y} data points
                  key: 'Sine Wave', //key  - the name of the series.
                  color: '#ff7f0e'  //color - optional: choose your own line color.
              }
          ];
  
          var x = i;
          setInterval(() =&gt; {
  
              this.data[0].values.push({ x: i, y: Math.sin(i / 10), series: 0 })
  
              i++;
          }, 500);
  
  
  
      }
  }
  </code></pre>