Echarts-wordcloud version compatibility problem after using echarts4.0 word cloud color is not, how to solve?

clipboard.png
after using the echarts4.0 version, the word cloud color will be lost, and echarts-wordcloud supports up to the echats3.6 version. If you use the echats3.6 version of the existing chart will be invalid, there is no solution to greatly help me

Sep.16,2021

feel that the project becomes a new piece,

npm install --save echarts-wordcloud

Import the wordcloud module in the module used or any module before loading the echart-wc module

require("echarts-wordcloud")

you can use
https://www.npmjs.com/package.

here.

is compatible. Note that the official example code is not up-to-date. Use textStyle instead of the itemStyle attribute
https://www.npmjs.com/package. (you can refer to this document)

"echarts": "^4.0.4",
"echarts-wordcloud": "^1.1.3",
myOption:{
                    series: [{
                        name: '',
                        type: 'wordCloud',
                        size: ['90%', '90%'],
                        textRotation : [-90, 90],
                        shape: 'circle',
                        autoSize: {
                            enable: true,
                            minSize: 14
                        },

                        data:[
                            {
                                name: "OFO",
                                value: 224,
                                textStyle: this.createRandomItemStyle(0)
                            },{
                                name: "",
                                value: 2142,
                                textStyle: this.createRandomItemStyle(1)
                            },{
                                name: "",
                                value: 12,
                                textStyle: this.createRandomItemStyle(2)
                            },{
                                name: "",
                                value: 99,
                                textStyle: this.createRandomItemStyle(3)
                            },{
                                name: "",
                                value: 20,
                                textStyle: this.createRandomItemStyle(4)
                            },{
                                name: "",
                                value: 1230,
                                textStyle: this.createRandomItemStyle(5)
                            },
                        ]
                    }]
                }

< script src= > supported version of word cloud map < / script >
< script > drawing word cloud image < / script >

< script src= < versions supported by other pictures > < / script >
< script > draw other pictures < / script >


I ended up using the echart3.6.2 version and echarts-wordcloud.min.js implementation, changing the previous 4.0 chart to 3.6.2 compatible

Menu