Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fix(stacked-series-chart): Temporarily fixes an issue where this comp…
Browse files Browse the repository at this point in the history
…onent would throw an assertion error in certain cases.
  • Loading branch information
thomaspink committed Feb 5, 2021
1 parent 9331d0a commit 4c47dae
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,22 @@ export class DtStackedSeriesChart implements OnDestroy {
merge(this._shouldUpdateTicks, this._resizer.change())
.pipe(
tap(() => {
// Recalculate every time the size changes
this._isAnyLabelOverflowing();
this._changeDetectorRef.detectChanges();
// HOTFIX: This If-statement is there to limit the error/exeption for now
// that would normally happen here.
// A deeper look into the root cause should be done
//
// Reproduce:
// Remove this if statement, run the demos app (`npm run demos `) and
// got the "stacked-series-chart-column-example".
//
// PR that initially introduced this issue:
// https://github.com/dynatrace-oss/barista/pull/1916/files
// Issue on angular: https://github.com/angular/angular/issues/32756
if (this.labelAxisMode === 'auto' && this.mode === 'column') {
// Recalculate every time the size changes
this._isAnyLabelOverflowing();
this._changeDetectorRef.detectChanges();
}
}),
// Shift the updating/rendering to the next CD cycle,
// because we need the dimensions of axis first, which is rendered in the main cycle.
Expand Down

0 comments on commit 4c47dae

Please sign in to comment.