MCPcopy
hub / github.com/chartjs/Chart.js / destroy

Method destroy

src/core/core.controller.js:937–955  ·  src/core/core.controller.js::Chart.destroy
()

Source from the content-addressed store, hash-verified

935 }
936
937 destroy() {
938 this.notifyPlugins(class="st">'beforeDestroy');
939 const {canvas, ctx} = this;
940
941 this._stop();
942 this.config.clearCache();
943
944 if (canvas) {
945 this.unbindEvents();
946 clearCanvas(canvas, ctx);
947 this.platform.releaseContext(ctx);
948 this.canvas = null;
949 this.ctx = null;
950 }
951
952 delete instances[this.id];
953
954 this.notifyPlugins(class="st">'afterDestroy');
955 }
956
957 toBase64Image(...args) {
958 return this.canvas.toDataURL(...args);

Callers 8

AppFunction · 0.80
AppAutoFunction · 0.80
createChartFunction · 0.80

Calls 6

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

Tested by

no test coverage detected