Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo Angular UI Gauges resize themself after update

Im using the RedialGauge from Kendo UI together with angular.

Im loading my data for the gauges dynamically from an api with rxjs every 3 minutes, here is my code:

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;
      ...
   });

After the init load all is fine and the gauges look like they supposed to enter image description here

But after the next update the gauges resize them self randomly enter image description here

like image 525
Norbert Bartko Avatar asked Nov 17 '22 01:11

Norbert Bartko


1 Answers

That's the result I came up with, it is kinda hacky but it's the only solution that really works.

I basicly reload the component when I want to update the gauges.

public refreshComponent(): void {
   const url = this.router.url;
   this.router.navigateByUrl('/app', {skipLocationChange: true}).then(() => {
      this.router.navigate([url]);
   });
}
like image 112
Norbert Bartko Avatar answered Dec 15 '22 17:12

Norbert Bartko