Skip to content

Commit f9f782c

Browse files
committed
fix(chartjs): undefined changes.data
1 parent fc4d6bd commit f9f782c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

projects/coreui-angular-chartjs/src/lib/chartjs.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ export class ChartjsComponent implements IChartjs, AfterViewInit, OnDestroy, OnC
108108

109109
ngAfterViewInit(): void {
110110
this.chartRender();
111-
this.chartUpdate();
111+
// this.chartUpdate();
112112
}
113113

114114
ngOnChanges(changes: SimpleChanges): void {
115-
if (!changes.data.firstChange) {
115+
if (changes.data && !changes.data.firstChange) {
116116
this.chartUpdate();
117117
}
118118
}
@@ -160,7 +160,7 @@ export class ChartjsComponent implements IChartjs, AfterViewInit, OnDestroy, OnC
160160

161161
const ctx: CanvasRenderingContext2D = this.canvasElement.nativeElement.getContext('2d');
162162

163-
return this.ngZone.runOutsideAngular(() => {
163+
this.ngZone.runOutsideAngular(() => {
164164
const config = this.chartConfig();
165165
if (config) {
166166
this.chart = new Chart(ctx, config);

0 commit comments

Comments
 (0)