Kendo Angular UI Gauges在更新后自行调整大小

Nor*_*tko 5 kendo-ui angular

我正在使用Kendo UI中的RedialGauge和angular。

rxjs每3分钟从一个api动态加载我的仪表数据,这是我的代码:

interval(2e5)
   .pipe(
      startWith(() => forkJoin(
          this.service.getStatistics(),
          this.service.otherCall()
        )
      ),
      switchMap(() => forkJoin(
          this.service.getStatistics(),
          this.service.otherCall()
        )
      ),
      retryWhen((err) => err.pipe(
          take(3)
        )
      )
   ).subscribe(([statistics, others]) => {
      this.statistics = statistics;
      ...
   });
Run Code Online (Sandbox Code Playgroud)

初始化加载后,一切都很好,仪表看起来像他们应该的 在此处输入图片说明

但是在下一次更新后,压力表会自行随机调整大小 在此处输入图片说明

Nor*_*tko 1

这就是我想出的结果,虽然有点老套,但这是唯一真正有效的解决方案。

当我想更新仪表时,我基本上会重新加载组件。

public refreshComponent(): void {
   const url = this.router.url;
   this.router.navigateByUrl('/app', {skipLocationChange: true}).then(() => {
      this.router.navigate([url]);
   });
}
Run Code Online (Sandbox Code Playgroud)