echarts-wordcloud icon indicating copy to clipboard operation
echarts-wordcloud copied to clipboard

echarts-cloud结合vue-echarts-v3使用,报[Vue warn]: Error in mounted hook: "Error: Component series.wordCloud not exists. Load it first."

Open tuotuogenjudi opened this issue 7 years ago • 3 comments

tuotuogenjudi avatar Nov 08 '17 02:11 tuotuogenjudi

需要引入echarts-wordcloud

zhangya5847 avatar Dec 07 '17 02:12 zhangya5847

有解决这个问题吗?要如何才能在vue-echarts中引入echarts-cloud呢?

DQinYuan avatar May 03 '18 18:05 DQinYuan

直接下载依赖,npm install echarts-wordcloud --save,然后在你的页面引入:import 'echarts-wordcloud'; 在调用onready方法:代码如下: 页面:

methods: onReady(instance, echarts) { const that = this; that.ins = instance; that.echarts = echarts; // const maskImage = new Image(); // maskImage.src = img; that.wordcloud = { tooltip: {}, series: [ { type: 'wordCloud', gridSize: 10, sizeRange: [12, 50], rotationRange: [-90, 90], // shape: 'circle', // maskImage, left: 'center', top: 'center', width: '90%', height: '90%', drawOutOfBound: true, textStyle: { normal: { color() { const result = rgb(${[ Math.round(Math.random() * 160), Math.round(Math.random() * 160), Math.round(Math.random() * 160), ].join(',')}); return result; }, }, emphasis: { shadowBlur: 10, shadowColor: '#333', }, }, data: [], }, ], // graphic: { // elements: [{ // type: 'image', // left: 'center', // style: { // image: img4, // width: 600, // x: 0, // y: 0, // height: 600, // }, // }], // }, }; },

tuotuogenjudi avatar May 15 '18 01:05 tuotuogenjudi