How to use the setCanvasCreator function from echarts
Find comprehensive JavaScript echarts.setCanvasCreator code examples handpicked from public code repositorys.
GitHub: miravideo/FFCreator

75 76 77 78 79 80 81 82 83 84
...option }; this.aniDuration = option.animationDurationUpdate; const canvasCreator = this.createCanvas(128, 128); echarts.setCanvasCreator(() => canvasCreator); this.option = option; this.chart = echarts.init(this.canvas, theme); this.fixZRender(); // 必须放在setOption之前
+ 3 other calls in file
GitHub: ChronSyn/FFCreator

108 109 110 111 112 113 114 115 116 117
} initECahrts() { const [width, height] = this.getWH(); const ctx = createCanvas(128, 128); echarts.setCanvasCreator(() => ctx); const { theme, option } = this; const canvas = createCanvas(width, height); const chart = echarts.init(canvas, theme);
9 10 11 12 13 14 15 16 17 18
generateImage (options, savePath, size) { return new Promise((resolve, reject) => { const canvas = createCanvas(400, 200); const ctx = canvas.getContext('2d'); ctx.font = '12px 楷体'; echarts.setCanvasCreator(function () { return canvas; }); const chart = echarts.init(canvas); options.animation = false;
echarts.init is the most popular function in echarts (114 examples)