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

Method destroy

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

Source from the content-addressed store, hash-verified

939 }
940
941 destroy() {
942 this.notifyPlugins('beforeDestroy');
943 const {canvas, ctx} = this;
944
945 this._stop();
946 this.config.clearCache();
947
948 if (canvas) {
949 this.unbindEvents();
950 clearCanvas(canvas, ctx);
951 this.platform.releaseContext(ctx);
952 this.canvas = null;
953 this.ctx = null;
954 }
955
956 delete instances[this.id];
957
958 this.notifyPlugins('afterDestroy');
959 }
960
961 toBase64Image(...args) {
962 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