Skip to content

Commit 568ebc2

Browse files
committed
fix(mainChart): chart.js - Cannot read properties of undefined _clip (reading 'disabled') - fixed by stop() current animations
Uncaught TypeError: Cannot read properties of undefined (reading 'disabled') at getDatasetClipArea (helpers.dataset.js:2775:14)
1 parent fa23f00 commit 568ebc2

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/app/views/charts/charts.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<c-row>
22
<c-col xs="12">
33
<app-docs-callout href="charts">
4-
CoreUI Angular wrapper component for Chart.js 4.5, the most popular charting library.
4+
CoreUI Angular wrapper component for Chart.js 4.x, the most popular charting library.
55
<br>
66
</app-docs-callout>
77
</c-col>

src/app/views/dashboard/dashboard.component.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NgStyle } from '@angular/common';
2-
import { Component, DestroyRef, effect, inject, OnInit, Renderer2, signal, WritableSignal, DOCUMENT } from '@angular/core';
2+
import { Component, DestroyRef, DOCUMENT, effect, inject, OnInit, Renderer2, signal, WritableSignal } from '@angular/core';
33
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
44
import { ChartOptions } from 'chart.js';
55
import {
@@ -13,11 +13,9 @@ import {
1313
ColComponent,
1414
FormCheckLabelDirective,
1515
GutterDirective,
16-
ProgressBarDirective,
1716
ProgressComponent,
1817
RowComponent,
19-
TableDirective,
20-
TextColorDirective
18+
TableDirective
2119
} from '@coreui/angular';
2220
import { ChartjsComponent } from '@coreui/angular-chartjs';
2321
import { IconDirective } from '@coreui/icons-angular';
@@ -41,9 +39,9 @@ interface IUser {
4139
}
4240

4341
@Component({
44-
templateUrl: 'dashboard.component.html',
45-
styleUrls: ['dashboard.component.scss'],
46-
imports: [WidgetsDropdownComponent, TextColorDirective, CardComponent, CardBodyComponent, RowComponent, ColComponent, ButtonDirective, IconDirective, ReactiveFormsModule, ButtonGroupComponent, FormCheckLabelDirective, ChartjsComponent, NgStyle, CardFooterComponent, GutterDirective, ProgressBarDirective, ProgressComponent, WidgetsBrandComponent, CardHeaderComponent, TableDirective, AvatarComponent]
42+
templateUrl: 'dashboard.component.html',
43+
styleUrls: ['dashboard.component.scss'],
44+
imports: [WidgetsDropdownComponent, CardComponent, CardBodyComponent, RowComponent, ColComponent, ButtonDirective, IconDirective, ReactiveFormsModule, ButtonGroupComponent, FormCheckLabelDirective, ChartjsComponent, NgStyle, CardFooterComponent, GutterDirective, ProgressComponent, WidgetsBrandComponent, CardHeaderComponent, TableDirective, AvatarComponent]
4745
})
4846
export class DashboardComponent implements OnInit {
4947

@@ -151,6 +149,7 @@ export class DashboardComponent implements OnInit {
151149
}
152150

153151
initCharts(): void {
152+
this.mainChartRef()?.stop();
154153
this.mainChart = this.#chartsData.mainChart;
155154
}
156155

0 commit comments

Comments
 (0)