MCPcopy Create free account
hub / github.com/chartjs/Chart.js / destroy

Method destroy

src/core/core.controller.js:1019–1038  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1017 }
1018
1019 destroy() {
1020 this.notifyPlugins('beforeDestroy');
1021 const {canvas, ctx} = this;
1022
1023 this._stop();
1024 this._doResize.cancel();
1025 this.config.clearCache();
1026
1027 if (canvas) {
1028 this.unbindEvents();
1029 clearCanvas(canvas, ctx);
1030 this.platform.releaseContext(ctx);
1031 this.canvas = null;
1032 this.ctx = null;
1033 }
1034
1035 delete instances[this.id];
1036
1037 this.notifyPlugins('afterDestroy');
1038 }
1039
1040 toBase64Image(...args) {
1041 return this.canvas.toDataURL(...args);

Callers 11

AppFunction · 0.80
AppAutoFunction · 0.80
createChartFunction · 0.80
onResizeFunction · 0.80

Calls 7

notifyPluginsMethod · 0.95
_stopMethod · 0.95
unbindEventsMethod · 0.95
clearCanvasFunction · 0.85
cancelMethod · 0.80
clearCacheMethod · 0.80
releaseContextMethod · 0.45

Tested by 2

createChartFunction · 0.64
onResizeFunction · 0.64