ecomfe / echarts-wordcloud

Word Cloud extension based on Apache ECharts and wordcloud2.js
1.66k stars 708 forks source link

angular 使用数据重复加载且溢出,求解决办法 #91

Open MarksMeng opened 5 years ago

MarksMeng commented 5 years ago

"echarts": "^4.0.0", "echarts-wordcloud": "^1.1.3", "ngx-echarts": "^4.1.1",

this.echartOption = {
            backgroundColor: 'transparent',//背景色
            title: {
                text: this.report.title,
                subtext: this.report.controlDesc,
            },
            tooltip: {
                show: true
            },
            series: [{
                type: 'wordCloud',

                //词云的形状
                shape: 'circle',

                //词云的位置大小
                left: 'center',
                top: 'center',
                width: '90%',
                height: '80%',
                right: null,
                bottom: null,

                //字体大小范围[最小值,最大值]
                sizeRange: [12,60],

                //词语旋转角度
                rotationRange: [0, 0],
                //每次旋转多少度
                rotationStep: 45,

                //字符间距
                gridSize: 5,

                drawOutOfBound: false,

                textStyle: {
                    normal: {
                        fontFamily: 'sans-serif',
                        fontWeight: 'bold',
                        // Color can be a callback function or a color string
                        color: function () {
                            // Random color
                            var index = Math.floor(Math.random() * 10);
                            return themeColor[index];
                        }
                    },
                    emphasis: {
                        shadowBlur: 1,
                        shadowColor: '#333'
                    }
                },

                data: this.dataset.sort(function (a, b) {
                    return b.value - a.value
                }),
            }]
}

image

kouxiangxinfu commented 4 years ago

请问一下拟解决这个问题了吗 ? 我现在也遇到这个问题了

mrlionline commented 4 years ago

同样的问题无法解决,偶现,数据正确,显示重复 windows10系统 chrome 81.0.4044.138(正式版本) (64 位)小概率复现 360极速浏览器大概率复现