echarts5.x 使用echarts-wordcloud2版本,参考官方Github https://github.com/ecomfe/echarts-wordcloud
且要注意写法,textStyle 设置随机色时,不用加normal,否则会出不了颜色

var chart = echarts.init(document.getElementById('main'));chart.setOption({...series: [{type: 'wordCloud',// The shape of the "cloud" to draw. Can be any polar equation represented as a// callback function, or a keyword present. Available presents are circle (default),// cardioid (apple or heart shape curve, the most known polar equation), diamond (// alias of square), triangle-forward, triangle, (alias of triangle-upright, pentagon, and star.shape: 'circle',// A silhouette image which the white area will be excluded from drawing texts.// The shape option will continue to apply as the shape of the cloud to grow.maskImage: maskImage,// Folllowing left/top/width/height/right/bottom are used for positioning the word cloud// Default to be put in the center and has 75% x 80% size.left: 'center',top: 'center',width: '70%',height: '80%',right: null,bottom: null,// Text size range which the value in data will be mapped to.// Default to have minimum 12px and maximum 60px size.sizeRange: [12, 60],// Text rotation range and step in degree. Text will be rotated randomly in range [-90, 90] by rotationStep 45rotationRange: [-90, 90],rotationStep: 45,// size of the grid in pixels for marking the availability of the canvas// the larger the grid size, the bigger the gap between words.gridSize: 8,// set to true to allow word being draw partly outside of the canvas.// Allow word bigger than the size of the canvas to be drawndrawOutOfBound: false,// If perform layout animation.// NOTE disable it will lead to UI blocking when there is lots of words.layoutAnimation: true,// Global text styletextStyle: {fontFamily: 'sans-serif',fontWeight: 'bold',// Color can be a callback function or a color stringcolor: function () {// Random colorreturn 'rgb(' + [Math.round(Math.random() * 160),Math.round(Math.random() * 160),Math.round(Math.random() * 160)].join(',') + ')';}},emphasis: {focus: 'self',textStyle: {shadowBlur: 10,shadowColor: '#333'}},// Data is an array. Each array item must have name and value property.data: [{name: 'Farrah Abraham',value: 366,// Style of single texttextStyle: {}}]}]
});

因为项目使用echarts3.x版本,那么echarts-wordcloud2版本的就没法使用了,在网上找到一个博主分享的
echarts4.0使用wordCloud的方法(支持彩色字体)
采用他分享的echarts-wordcloud版本就可以兼容了echart3.x版本

下载地址:点我下载
下载密码:fabw

注意:里面案例的写法,textStyle是有加normal的,且是有动态效果的

 var option = {series: [ {type: 'wordCloud',sizeRange: [10, 100],rotationRange: [-90, 90],rotationStep: 45,gridSize: 2,shape: 'pentagon',maskImage: maskImage,drawOutOfBound: false,textStyle: {normal: {color: function () {return 'rgb(' + [Math.round(Math.random() * 160),Math.round(Math.random() * 160),Math.round(Math.random() * 160)].join(',') + ')';}},emphasis: {color: 'red'}},data: data.sort(function (a, b) {return b.value  - a.value;})} ]};

echarts3.x,echarts5.x 的wordCloud兼容相关推荐

  1. echarts5.x 词云图使用(`[ECharts] Unkown series wordCloud`)

    文章目录 echarts5.x 词云图使用(`[ECharts] Unkown series wordCloud`) 背景 预期效果 样例代码 自定义形状 动效 echarts5.x 词云图使用([E ...

  2. 在echarts3中使用字符云

    echarts2的官方API里是带有字符云的,但到了echarts3就被从官网上移除了,想要使用的话可以从github上下载: 下载地址:https://github.com/ecomfe/echar ...

  3. 使用python的wordcloud包实现中文标签云制作

    一.前言 数据分析报告之中文标签云 在我的前一篇博客(python爬虫爬取拉勾网职业信息)中,获得了一份格式化的职业信息数据,不清楚的可以看看我的上一篇博客. python制作标签云的包有几个,我这里 ...

  4. Echarts3 使用详解

    因为项目需要,要求实现类似力导图效果的图,我就瞄上了echarts. 注意事项1:由于我的项目要部署到内网,所以js文件要在本地,网上大多力导图都是echarts2的,而其又依赖zrender基础库, ...

  5. 用echarts3和worldcloud制作炫酷的字符云图

    最近有个项目需要做出云图来,一开始还不知道云图是什么鬼,直到需求在网上找了个图我才恍然大悟,但是大悟完就开始一脸懵逼了,这玩意怎么做?因为当时项目紧,项目经理就先叫我用photoshop画了一个云图给 ...

  6. Echarts3 关系图-力导向布局图

    因为项目需要,要求实现类似力导图效果的图,我就瞄上了echarts. 注意事项1:由于我的项目要部署到内网,所以js文件要在本地,网上大多力导图都是echarts2的,而其又依赖zrender基础库, ...

  7. python程序创建词云 中国地图_Python基于wordcloud及jieba实现中国地图词云图

    热词图很酷炫,也非常适合热点事件,抓住重点,以图文结合的方式表现出来,很有冲击力.下面这段代码是制作热词图的,用到了以下技术: jieba,把文本分词 wordcloud,制作热图 chardet,辨 ...

  8. IE8 + JQuery1.12.4 兼容之旅

    公司的产品大部分的用户可能还在使用IE8,无奈兼容IE8重构中,其实对于兼容IE8没有太多的抗拒,这么久了网上关于如何兼容IE的资料比较多,整体看来没有什么特别大的坑. 起手式 如果需要兼容IE8,那 ...

  9. 解决echarts5中国地图只显示南海问题,及china.js china.json下载

    问题: echarts5中国地图,只显示南海 说明: echarts3版本后,因为版权问题,echarts不再内置中国地图,也没有中国地图数据,网上找的又很多有问题,或者语焉不详... 1:需要手动引 ...

最新文章

  1. Genymotion模拟器的安装及常见问题解决方法
  2. C++类模版------STL的原理
  3. 怎么样用 Python 玩转 Redis !过来 咱一起聊聊!
  4. candence的图纸大小设置_提前感受一下,CAD高手的字体和标注设置原则
  5. 全栈路线_程序员该走全栈路线还是深度专家路线?
  6. 用java实现页面搜索功能_关于如何利用矩阵实现搜索功能
  7. 【C++笔记】表达式 语句
  8. python怎么在运行中查看执行状态_python,_python程序运行时 查看对象状态,python - phpStudy...
  9. Python内置的服务器的使用
  10. torch.optim.lr_scheduler.MultiStepLR()用法研究 台阶/阶梯学习率
  11. 疾病自动编码(ICD Coding)任务的调研
  12. 计算机审计风险背景,计算机审计风险探究
  13. 题6.12:有一行电文,已按照下面规律翻译成密码: A->Z a->z B->Y b->y C->X c->x即第1个字母编程第26个字母,第i个字母编程第(26-i+1)个字母,非字母字符不变,要求
  14. Tomcat下发布war包产生两个不同版本的访问地址的解决方案appBase和docBase的关系
  15. erlang io:format io_lib:format
  16. 下列叙述中正确的是计算机课,大学计算机课程练习题(期末)
  17. C++基础概念(初步代码示例英石与磅单位互换)
  18. vim ctrl + s 终端假死?
  19. 【ECDH java后端和javaScript前后端互通实现】
  20. 手绘动画用哪个软件比较好?分享5个好用的手绘动画软件

热门文章

  1. 宁波9家游戏开发运营公司简介
  2. umi_tools使用
  3. SVN客户端安装和服务器搭建
  4. python安装镜像numpy_[Python]使用镜像网站自动、自动和手动安装numpy,Numpy
  5. 网络调试工具TCP/UDP socket的使用
  6. 公网安备 域名公安网线上备案流程 网安备案 ICP备案
  7. 【Numpy】改变数组维数
  8. ConstraintSystem:59
  9. SQL Server 2012 安装包
  10. lisp 河道水面线计算_天然河道水面线计算程序