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

Commit

Permalink
fix(chart): Fixes an issue with the overlay of the selection area not
Browse files Browse the repository at this point in the history
updating.

Fixes #608
  • Loading branch information
tomheller committed Feb 17, 2020
1 parent ad5bc8f commit d640ee4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/dev/src/chart/chart-demo.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
(valueChanges)="onTimeframeChanges($event)"
></dt-chart-timestamp>
</dt-chart>

<button (click)="setTimeframe()">set timeframe</button>
<button (click)="switchData()">change</button>

<dt-chart
Expand Down
8 changes: 8 additions & 0 deletions apps/dev/src/chart/chart-demo.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,12 @@ export class ChartDemo {
seriesVisibilityChanged(event: DtChartSeriesVisibilityChangeEvent): void {
console.log(event);
}

setTimeframe(): void {
this.lastTimeframe = [
this.lastTimeframe[0] - 100_000,
this.lastTimeframe[1] + 100_000,
];
this.dtChartRange.value = this.lastTimeframe;
}
}
3 changes: 3 additions & 0 deletions components/chart/src/selection-area/selection-area.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
ViewChild,
ViewContainerRef,
ViewEncapsulation,
ChangeDetectorRef,
} from '@angular/core';
import {
_addCssClass,
Expand Down Expand Up @@ -185,6 +186,7 @@ export class DtChartSelectionArea implements AfterContentInit, OnDestroy {
private _viewportRuler: ViewportRuler,
private _platform: Platform,
private _overlayContainer: OverlayContainer,
private _changeDetectorRef: ChangeDetectorRef,
// tslint:disable-next-line: no-any
@Inject(DOCUMENT) private _document: any,
@Optional() private _viewportResizer: DtViewportResizer,
Expand Down Expand Up @@ -828,6 +830,7 @@ export class DtChartSelectionArea implements AfterContentInit, OnDestroy {
ref,
viewPortOffset,
);
this._changeDetectorRef.markForCheck();
}
});
}
Expand Down

0 comments on commit d640ee4

Please sign in to comment.