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之前
320
100
3
+ 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);
320
0
0
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;
12
28
1
echarts.init is the most popular function in echarts (114 examples)