手记

Angular6 调用echarts的wordcloud插件,没有丢失标签的bug

this.accountCloudOptions = {
      series: [{
        type: 'wordCloud',
        size: ['80%', '80%'],
        textRotation: [0, 45, 90, -45],
        textPadding: 0,
        autoSize: {
          enable: true,
          minSize: 14
        },
        data: accountCloudList
      }]
    };
accountCloudList = [{
'name': 'a1',
'value': 123,
'textStyle': this.createRandomItemStyle()
}];
createRandomItemStyle() {
    return {
      normal: {
        color: 'rgb(' + [
          Math.round(Math.random() * 160),
          Math.round(Math.random() * 160),
          Math.round(Math.random() * 160)
        ].join(',') + ')'
      }
    };
  }
0人推荐
随时随地看视频
慕课网APP