哈利路亚
Let's take one million years picnic
欢迎来到Sean Cleveland的博客
软工超越日报-热词云图 5/6
function colud(doap){
            chart = echarts.init(document.getElementById('helloword'));
            var maskImage = new Image();
            maskImage.src = './logo.png';

            var option = {
                tooltip: {},
                series: [ {
                    type: 'wordCloud',
                    gridSize: 0,
                    sizeRange: [10,25],
                    rotationRange: [-80, 80],
                    shape: 'pentagon',
                    drawOutOfBound: false,
                    textStyle: {
                        color: function () {
                            return 'rgb(' + [
                                Math.round(Math.random() * 160),
                                Math.round(Math.random() * 160),
                                Math.round(Math.random() * 160)
                            ].join(',') + ')';
                        }
                    },
                    emphasis: {
                        show:true,
                        textStyle:{
                            fontSize:30,
                            fontWeight:'bold'
                        }
                    },
                        data:doap
                    } ]
                };
            option.series[0].maskImage;
            chart.setOption(option);
            
            chart.on('click', function (params) {          //点击事件
                var str_p = params.data.name;
                var str_v = params.data.value;
                console.log(str_p);
                bench(ids);
                ids.push(str_p);
                rench(str_p);
                var sp = document.getElementById(str_p).parentNode.parentNode;
                sp.scrollTop = 1800;
                kewords("iccvtable",str_p);
                kewords("eccvtable",str_p);
                kewords("cvrptable",str_p);
                changetitle();
            });
        }            

最后的效果大概是这种感觉:

 

posted on 2021-05-06 22:10  哈利路亚#0207  阅读(45)  评论(0编辑  收藏  举报
Live2D