ecomfe / echarts-wordcloud

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

有什么方法可以保证某几个词一定显示吗? #147

Open HesterG opened 2 years ago

HesterG commented 2 years ago
let options = {
    series: [ {
      type: 'wordCloud',
      sizeRange: [8, 40],
      rotationRange: [-90, 90],
      gridSize: 0,
      shape: 'circle',
      maskImage: maskImage,
      drawOutOfBound: true,
      layoutAnimation: false,
      keepAspect: true,
      textStyle: {
        fontWeight: 'bold',
        color: function () {
          return 'rgb(' + [
            Math.round(Math.random() * 200) + 50,
            Math.round(Math.random() * 50),
            Math.round(Math.random() * 50) + 50
          ].join(',') + ')';
        }
      },
      emphasis: {
        textStyle: {
          color: '#528'
        }
      },
      data: wordData
    }]
  };

用了maskImage 但是希望某些单词一定显示 ,如果设置drawOutOfBoundfalse会导致单词重叠,有什么别的方法吗

Sai0514 commented 2 years ago

同问,不知是否有解决方案?