Highcharts 样条线每秒更新一次显示和消失

Highcharts 样条线每秒更新一次显示和消失,highcharts,angular2-highcharts,Highcharts,Angular2 Highcharts,我对样条曲线图每秒更新一次有问题。每次重新绘制图表,使其不显示恒定波 下面是它的外观 我试过这样做 this.timeinterval = setInterval(() => { const x = (new Date()).getTime() + 7200000; // current time if (this.voltage) { this.chart['series'][0].addPoint([x, this.voltage], true, true

我对样条曲线图每秒更新一次有问题。每次重新绘制图表,使其不显示恒定波

下面是它的外观

我试过这样做

this.timeinterval = setInterval(() => {
    const x = (new Date()).getTime() + 7200000; // current time
    if (this.voltage) {
      this.chart['series'][0].addPoint([x, this.voltage], true, true);
    }
  }, 250);

如何修复它以使其顺利运行。

您的代码建议图表每250毫秒更新一次,我认为这不够让图表在获得新点之前完成绘制,这可能是问题所在。尝试查看console中的“性能”选项卡,以了解更详细的情况。我已更改为1000毫秒,但结果相同。我在ionic 3移动应用程序中使用了相同的图表,它工作正常。很抱歉,我在我的模板中检查条件,每次都会得到值,这就是为什么渲染图表需要一些时间的原因。谢谢你@ewolden