Skip to content

Commit eac34ba

Browse files
authored
Check if chart is already connected
1 parent 3e2b89a commit eac34ba

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Chartjs/assets/dist/controller.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ class default_1 extends Controller {
2020
if (!(this.element instanceof HTMLCanvasElement)) {
2121
throw new Error('Invalid element');
2222
}
23+
if(Chart.getChart(this.element)) {
24+
// Chart is already connected
25+
return;
26+
}
2327
const payload = this.viewValue;
2428
if (Array.isArray(payload.options) && 0 === payload.options.length) {
2529
payload.options = {};

0 commit comments

Comments
 (0)