echarts实现词云自定义形状的示例代码
程序员文章站
2023-11-12 11:49:46
安装
npm install echarts
npm install echarts-wordcloud
词云安装官网
下面是一个小鸟形状的词云,...
安装
npm install echarts npm install echarts-wordcloud
词云安装官网
下面是一个小鸟形状的词云,可以在iconfont中下载(最好是填充的)图案,转为base64,就可以用来生成有图案的词云了
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>wordcloud demo</title> <script type="text/javascript" src="./echarts.js"></script> <script type="text/javascript" src="./echarts-wordcloud.min.js"></script> </head> <body> <div id="main" style="width: 800px; height: 600px"></div> <script> onload = function () { var data = { value: [{ "name": "花鸟市场", "value": 1446 }, { "name": "汽车", "value": 928 }, { "name": "视频", "value": 906 }, { "name": "电视", "value": 825 }, { "name": "lover boy 88", "value": 514 }, { "name": "动漫", "value": 486 }, { "name": "音乐", "value": 53 }, { "name": "直播", "value": 163 }, { "name": "广播电台", "value": 86 }, { "name": "戏曲曲艺", "value": 17 }, { "name": "演出票务", "value": 6 }, { "name": "给陌生的你听", "value": 1 }, { "name": "资讯", "value": 1437 }, { "name": "商业财经", "value": 422 }, { "name": "娱乐八卦", "value": 353 }, { "name": "军事", "value": 331 }, { "name": "科技资讯", "value": 313 }, { "name": "社会时政", "value": 307 }, { "name": "时尚", "value": 43 }, { "name": "网络奇闻", "value": 15 }, { "name": "旅游出行", "value": 438 }, { "name": "景点类型", "value": 957 }, { "name": "国内游", "value": 927 }, { "name": "远途出行方式", "value": 908 }, { "name": "酒店", "value": 693 }, { "name": "关注景点", "value": 611 }, { "name": "旅游网站偏好", "value": 512 }, { "name": "出国游", "value": 382 }, { "name": "交通票务", "value": 312 }, { "name": "旅游方式", "value": 187 }, { "name": "旅游主题", "value": 163 }, { "name": "港澳台", "value": 104 }, { "name": "本地周边游", "value": 3 }, { "name": "小卖家", "value": 1331 }, { "name": "全日制学校", "value": 941 }, { "name": "基础教育科目", "value": 585 }, { "name": "考试培训", "value": 473 }, { "name": "语言学习", "value": 358 }, { "name": "留学", "value": 246 }, { "name": "k12课程培训", "value": 207 }, { "name": "艺术培训", "value": 194 }, { "name": "技能培训", "value": 104 }, { "name": "it培训", "value": 87 }, { "name": "高等教育专业", "value": 63 }, { "name": "家教", "value": 48 }, { "name": "体育培训", "value": 23 }, { "name": "职场培训", "value": 5 }, { "name": "金融财经", "value": 1328 }, { "name": "银行", "value": 765 }, { "name": "股票", "value": 452 }, { "name": "保险", "value": 415 }, { "name": "贷款", "value": 253 }, { "name": "基金", "value": 211 }, { "name": "信用卡", "value": 180 }, { "name": "外汇", "value": 138 }, { "name": "p2p", "value": 116 }, { "name": "贵金属", "value": 98 }, { "name": "债券", "value": 93 }, { "name": "网络理财", "value": 92 }, { "name": "信托", "value": 90 }, { "name": "征信", "value": 76 }, { "name": "期货", "value": 76 }, { "name": "公积金", "value": 40 }, { "name": "银行理财", "value": 36 }, { "name": "银行业务", "value": 30 }, { "name": "典当", "value": 7 }, { "name": "海外置业", "value": 1 }, { "name": "汽车", "value": 1309 }, { "name": "汽车档次", "value": 965 }, { "name": "汽车品牌", "value": 900 }, { "name": "汽车车型", "value": 727 }, { "name": "购车阶段", "value": 461 }, { "name": "二手车", "value": 309 }, { "name": "汽车美容", "value": 260 }, { "name": "新能源汽车", "value": 173 }, { "name": "汽车维修", "value": 155 }, { "name": "租车服务", "value": 136 }, { "name": "车展", "value": 121 }, { "name": "违章查询", "value": 76 }, { "name": "汽车改装", "value": 62 }, { "name": "汽车用品", "value": 37 }, { "name": "路况查询", "value": 32 }, { "name": "汽车保险", "value": 28 }, { "name": "陪驾代驾", "value": 4 }, { "name": "网络购物", "value": 1275 }, { "name": "做我的猫", "value": 1088 }, { "name": "只想要你知道", "value": 907 }, { "name": "团购", "value": 837 }, { "name": "比价", "value": 201 }, { "name": "海淘", "value": 195 }, { "name": "移动app购物", "value": 179 }, { "name": "支付方式", "value": 119 }, { "name": "代购", "value": 43 }, { "name": "体育健身", "value": 1234 }, { "name": "体育赛事项目", "value": 802 }, { "name": "运动项目", "value": 405 }, { "name": "体育类赛事", "value": 337 }, { "name": "健身项目", "value": 199 }, { "name": "健身房健身", "value": 78 }, { "name": "运动健身", "value": 77 }, { "name": "家庭健身", "value": 36 }, { "name": "健身器械", "value": 29 }, { "name": "办公室健身", "value": 3 }, { "name": "商务服务", "value": 1201 }, { "name": "法律咨询", "value": 508 }, { "name": "化工材料", "value": 147 }, { "name": "广告服务", "value": 125 }, { "name": "会计审计", "value": 115 }, { "name": "人员招聘", "value": 101 }, { "name": "印刷打印", "value": 66 }, { "name": "知识产权", "value": 32 }, { "name": "翻译", "value": 22 }, { "name": "安全安保", "value": 9 }, { "name": "公关服务", "value": 8 }, { "name": "商旅服务", "value": 2 }, { "name": "展会服务", "value": 2 }, { "name": "特许经营", "value": 1 }, { "name": "休闲爱好", "value": 1169 }, { "name": "收藏", "value": 412 }, { "name": "摄影", "value": 393 }, { "name": "温泉", "value": 230 }, { "name": "博彩彩票", "value": 211 }, { "name": "美术", "value": 207 }, { "name": "书法", "value": 139 }, { "name": "diy手工", "value": 75 }, { "name": "舞蹈", "value": 23 }, { "name": "钓鱼", "value": 21 }, { "name": "棋牌桌游", "value": 17 }, { "name": "ktv", "value": 6 }, { "name": "密室", "value": 5 }, { "name": "采摘", "value": 4 }, { "name": "电玩", "value": 1 }, { "name": "真人cs", "value": 1 }, { "name": "轰趴", "value": 1 }, { "name": "家电数码", "value": 1111 }, { "name": "手机", "value": 885 }, { "name": "电脑", "value": 543 }, { "name": "大家电", "value": 321 }, { "name": "家电关注品牌", "value": 253 }, { "name": "网络设备", "value": 162 }, { "name": "摄影器材", "value": 149 }, { "name": "影音设备", "value": 133 }, { "name": "办公数码设备", "value": 113 }, { "name": "生活电器", "value": 67 }, { "name": "厨房电器", "value": 54 }, { "name": "智能设备", "value": 45 }, { "name": "个人护理电器", "value": 22 }, { "name": "服饰鞋包", "value": 1047 }, { "name": "服装", "value": 566 }, { "name": "饰品", "value": 289 }, { "name": "鞋", "value": 184 }, { "name": "箱包", "value": 168 }, { "name": "奢侈品", "value": 137 }, { "name": "母婴亲子", "value": 1041 }, { "name": "孕婴保健", "value": 505 }, { "name": "母婴社区", "value": 299 }, { "name": "早教", "value": 103 }, { "name": "奶粉辅食", "value": 66 }, { "name": "童车童床", "value": 41 }, { "name": "关注品牌", "value": 271 }, { "name": "宝宝玩乐", "value": 30 }, { "name": "母婴护理服务", "value": 25 }, { "name": "纸尿裤湿巾", "value": 16 }, { "name": "妈妈用品", "value": 15 }, { "name": "宝宝起名", "value": 12 }, { "name": "童装童鞋", "value": 9 }, { "name": "胎教", "value": 8 }, { "name": "宝宝安全", "value": 1 }, { "name": "宝宝洗护用品", "value": 1 }, { "name": "软件应用", "value": 1018 }, { "name": "系统工具", "value": 896 }, { "name": "理财购物", "value": 440 }, { "name": "生活实用", "value": 365 }, { "name": "影音图像", "value": 256 }, { "name": "社交通讯", "value": 214 }, { "name": "手机美化", "value": 39 }, { "name": "办公学习", "value": 28 }, { "name": "应用市场", "value": 23 }, { "name": "母婴育儿", "value": 14 }, { "name": "游戏", "value": 946 }, { "name": "手机游戏", "value": 565 }, { "name": "pc游戏", "value": 353 }, { "name": "网页游戏", "value": 254 }, { "name": "游戏机", "value": 188 }, { "name": "模拟辅助", "value": 166 }, { "name": "个护美容", "value": 942 }, { "name": "护肤品", "value": 177 }, { "name": "彩妆", "value": 133 }, { "name": "美发", "value": 80 }, { "name": "香水", "value": 50 }, { "name": "个人护理", "value": 46 }, { "name": "美甲", "value": 26 }, { "name": "spa美体", "value": 21 }, { "name": "花鸟萌宠", "value": 914 }, { "name": "绿植花卉", "value": 311 }, { "name": "狗", "value": 257 }, { "name": "其他宠物", "value": 131 }, { "name": "水族", "value": 125 }, { "name": "猫", "value": 122 }, { "name": "动物", "value": 81 }, { "name": "鸟", "value": 67 }, { "name": "宠物用品", "value": 41 }, { "name": "宠物服务", "value": 26 }, { "name": "书籍阅读", "value": 913 }, { "name": "网络小说", "value": 483 }, { "name": "关注书籍", "value": 128 }, { "name": "文学", "value": 105 }, { "name": "报刊杂志", "value": 77 }, { "name": "人文社科", "value": 22 }, { "name": "建材家居", "value": 907 }, { "name": "装修建材", "value": 644 }, { "name": "家具", "value": 273 }, { "name": "家居风格", "value": 187 }, { "name": "家居家装关注品牌", "value": 140 }, { "name": "家纺", "value": 107 }, { "name": "厨具", "value": 47 }, { "name": "灯具", "value": 43 }, { "name": "家居饰品", "value": 29 }, { "name": "家居日常用品", "value": 10 }, { "name": "生活服务", "value": 883 }, { "name": "物流配送", "value": 536 }, { "name": "家政服务", "value": 108 }, { "name": "摄影服务", "value": 49 }, { "name": "搬家服务", "value": 38 }, { "name": "物业维修", "value": 37 }, { "name": "婚庆服务", "value": 24 }, { "name": "二手回收", "value": 24 }, { "name": "鲜花配送", "value": 3 }, { "name": "维修服务", "value": 3 }, { "name": "殡葬服务", "value": 1 }, { "name": "求职创业", "value": 874 }, { "name": "创业", "value": 363 }, { "name": "目标职位", "value": 162 }, { "name": "目标行业", "value": 50 }, { "name": "兼职", "value": 21 }, { "name": "期望年薪", "value": 20 }, { "name": "实习", "value": 16 }, { "name": "雇主类型", "value": 10 }, { "name": "星座运势", "value": 789 }, { "name": "星座", "value": 316 }, { "name": "算命", "value": 303 }, { "name": "解梦", "value": 196 }, { "name": "风水", "value": 93 }, { "name": "面相分析", "value": 47 }, { "name": "手相", "value": 32 }, { "name": "公益", "value": 90 } ], //小鸟图片 image: "data:image/png;base64,ivborw0kggoaaaansuheugaaao4aaadicayaaadvg90jaaawneleqvr4xu2deds/5zzhx/6ymvjrki1ojwqjydaqiiljacgkhfsym5uksyifspaypixrijbjyjqtzbjljl2hxzpmrqeksxznzjz3dh1pt0/p83zv5bqv5b7fn3o+5+l3uu/r8/m8r/t9l9f1we6gxqgygeoquft1fttgi2aemhf9eribchewcsucnjtsbexcxwngoeietnwkj80mgwet19dabas2bdynv/sa9wlwatyevpuj7m/ab8lvzub64mrw+3lsq2sez8stefby2r4tsbtw/wveve+ajv0c+bxwofaz4gcd6ip+abo3+ckqxsb1gkcbewk7aqtntuwa4jpa24cfzlyluxotnznkvslca/h74onaywq2/elgncbvbdsy1tqtnyqcoxnsacaxgbb3r8grvuafcvxckc2dtdvxo8e22pm2crf+eyv38evauca3kvdjwfnn3lhobhu/tgje2f60os/q6/pyfpp/we3coq+7jmztd7wf0nn2jpkfskimraxszgngl+bfgnvaggfitkfrfme+fdhlfg7dxanbgbcawstkldrxfirwdgah4bha19oazek2rwwcx2vb6wofrxqpgfr5wofdddxntawepbn4h/cenr1+epcblvymqdytp7qs3wx0as5rimpubdirw4qva/ue6kyh9e8nhby21fzzpexrcid0nwai4uporjvm/sctxq3zeymhok2s2len+4kjmmpdgjv6drte+yoou6cknqyk9vxkpgqc2ed3bojugojlzdn3wmubqtuszsbwlnbygazkt+kk8nyrg7wk+3xm+g7dai5nxwce3tf72mq9gnjzaqo0krchchvfq31+bwqoad7ce5rxdachi67px3vwa/0qokjx4w0bnq/46occv2x4/lkhxsbuut9oyvj4ppdvvsb6/m4ikpj/v0kgtudbrnqiykstssbbmfcmc0xafw67rqdxhwnosd9byhj3xedgzsz6y3by37+w9ahcbjw6vdpqncrs6usqdbsu0slpc8o3a1en9gu+0fxkxeffjo6hwdvngpy84jxyxnucrggcapzf6egfplfd2rpxr4enigwmhau8msa8mynbdlxydcdxmz3wwmsiscrwy0dfy5y8clwbee5s1tgj+78tjnnyufbhmnxxtbjwhy5c4mq+e4vgszccegxfufcoswwqi7jk1fxsswmv5qx3/htanufdmygwxkgw11pxkh4bjfdrbvmv39elfnfpb/qe31zur+hxwhfbnujj5ylwcuc1c4/yaumg8nuwv/v9iqbxmlgiq62gb3u08vdhtc4rzh0bxoy0vypyku6qhq0hatob1kr+ybkdump2+huec18gnbphha9x+yuainqs6rfqznq83zxevsugrujey5uk6r3d2rurcqxwrqgamq5v6vfcul8whbkxihsacfxeyxvhtd8kwrwrvy12kmwha3hkkg6bswblaywrgmrvhqflwsquxxgi73/ghhqiyz3qi33jz1rzrgpn/f0qztgiq8wlosobvgh4uyowrqln+cbzi/glbjeuopaw4kc9jd0guhvnbcwofnpf6utckro680erzcpv1a3cmh8bvvrqelwldqjtss8osug7l1rtf3dmf5uwkgm8xtoxue8blkqaj6rwkzf/6jtealcgv/e/dnechoozaj1qvghvsyiiwwssiqd6t56o2ofztrqs3thxui9xxww8ohfmeuiq5jpfjskrs9hvba78mpqohnapbpqjp/xmkvk/bweydtk7f0vbxyc+xnxdrgwwukprj1mal1mxfvq+mtkgq2+hggixfmpqsvosv5xit2ulmc7b3wrfct+im9xorlhbkkjpy6nbpkxhvkxdrdtbs1/iql7tpvprjxockvo16vyoomonyhstjmtv2vi+agruumbgj+ldxk2qqqlxblgrrswlxwi7zo1lx/3qg6s2mjayeddn9ew+jvyhrlbnsnlvvckcrfangtjdb+he5/4i2cyrlqvphobalr6v26l3nnwhuiouka0anjoc/1nfuco+v00xg4rdrnz07a9h2rxpq9xhaf9wiir6c1b1jdjukimgmnftonxnhyqdfrrbqxc9qw9x1bbi7rxkfrwle/geuilokvclhzbyeiien9uhukrgxnosgjivjggnrsqbzrgw3dtlgoicgme01vrtxtdni4x1pyh6epdvmwrdxza443ikcfgbxexqpncctqjt7gdcv5rf0zzg5wtulmmqt7y+xfvol8qj1cicunndy63rxniqfy3xxfb26pnfbei/ozscpsrvrv4ftncmalpb3iobmgkq5+fman6rwsutaofwobqdsr/iyqiavzhvue4lhqsrxjjgmj5dyvhb4hh6kkldiblzbpw+xfxy8ly2gom60hnwtvhugdmxvd4rz1pvni15efanvl1dlevblehlxiuban+qdthq+ffdlsqkaidfuynerlsnrredetkqrwws6utc9qfqnzkuxlnusnqjusagso9qk01s3e1ra2zge/utk9im3bhos1xtlf86mda5hv/xqobbfxgio7zsm9piqjxcqodbgnrvxohq3wruvsrvx5o/tnjy18exhgofg7wsiajh6hokeosiw+ehrnznaw0zjpe+xjxbcppw7akxi4p4nvlbk3tnq/y1xt9ajmq2mbududscaic4bbk8liun1lk8mmgmbmravxhozvn1ezjfyhbxhmvfalzimosjizwqu+czgeqhjiuc3cbh2bjag+n8sh8evlxqnydzjbzxp1qew9/3ks72hkdvj3lll4f1chsxif2x+nmaslikvwgunxi/gpfgbp4gokbdourjbko2skrbibz/wlsbu7gyb97e2ojxnqcbmmqt6fu6zdnurx5vou5ii/rkrxdutdc5xcsujfffey2rw+5aqhvbwpx+sii0yctcyw7jnwybfs+4ny2qo2ujtvwvr1+qjumo30ruqs4dird6if37aab+b6benpy0ckyzq+piboiklnvcv0d0y3wevlnlw2lfdnve+kbgadyllfnsilb2jqgputyecuus/phmgvtr0aa+4qt10z6hcju16kw/iovdkyhdscp6jvflr0sabnq8pgmm8sytiyirsy/v2lohdd7wygsiika6x7qxjpehicthvgjsn9wjkzqc6rbq28yb06m7q9oqxnv+orzccvuwyogndu4labxhqtbjykwp2gcona53wpeyvr0caywxzsmog/kjownkja/vantibmagqar+lilzksvkth/s2gbn/kwegvt8uqvqxrqfcagrffvrxuxobu/y8uaguasuibvgltvaendwzuelo5q8r0igpiinftg0w9mtfjwrkbibgwdvfs8ibym7mgle+yhha+9sablcihuaatecnsogxstqhpff2hl3ucb5iyxvavpl47bpdhaiceiwj63ucmrb4dvatnggaj9kw+kefvrvlkxpvaeuu9pkiacafwbkjbiygdoqujlilrmmbktckfpgocz+fjgbuie8ealcuwxlqo+nxqjuhidwa/blzxbb4l4swgc2svcf76oiiwiq/he50rp3woayqjeofinqawl/dbyay9c2xnx3rbpatxu1q7osefhlxx4ssl80jkij1bbkokzcg7yd3mcbgqwivd40jcugun1an5pkqbmuxqhmhqh1wj49fwhtn7haeno6l7hwawqkqua5wltz2dowuaq8eeguy63xcbsewn6a1nyysfviuqzrlmmy0gir0lpmtn7ebymrrr51j7mygakjkc2jxsc3ja6kfr849rmz/0aga3eigtawucp4rslnfimwzqtugt5rr6y2xfwgrlyl8clfkfa9kat0yfjynba1je4tgi/nnni6juabccikv4k12aqtcvw7v1fpfimwzqt05vngnac0ja5svqyy6slajmbuedgfudin812ik4ofmnno6zycmrfq2o/3ctrqhbhhawfknnq6jubmbfyfbstpqxfiqo2m2mlajmauebgg2cq3412ik5tvtmowipfbb+s3aikrugo17efixymrinfvtomwdrmbqhb4zqkn7bosv5uqflmikdbdckreipukspztslyd+y5aoykwizalbdygrsvtcb/ibgaotqzfcewfatubx7cez/sqv/afaxxegio2wqgkqedhvkxempql7gaamixubtbibmaoqbelu32/cwetpdq/pftzjmdyedgtulqej/s+cwc+fbnyoqshbimrgbcbbb3of/sui7haafsuog5+fimwrgs+bwxximoxict/9g1tnevxzxyygzgikobi3takkjjeluovbv5ehgc2wgjerebjwefjdtl9tnjelsvn5a4o0b0on2kelkvgbecmuvazgrjy7uzgyfkctb1gocccrx3fypehikux9cqsv2eleagdgzobv5xkxjdelz+7akqdkijmrctgbutvcdwsukfkymro4srr9upn+t2k8dqggihmcbqtn7zq5btenelte2bvxnpz6uyxjy/mj4a68hwxbzesujocna3wqvn++efdfhibrggoqac4wukpittdavtqrcanxbpdoz4oewk3avfiphtftbmioznqf+dvwo4lgmobjo/ae4bdskqhn3fnmgwr8nqf5rxoei+tydqkmn5ploh9kcrdim1bie55n0d5vhyjkaobw4a1cyhuorne4i60w60mtrcseu8mbntekr9jbcigcc5wrirxbhmidoiudlo9i3ymub9a4hoycpdbkpggu0dgj0b55kvkbcrdckiirjhokddibgiiockiwncpvmojrkindwaobrqibtecqybqtg2p5zzlqdxtgfee0q7xaj8f/rkmgskqgjy2d9+6bnsyxgxqmrcjuett5jwmjqdxtvj3s68vi1aoah8jb3wfmne7wtmik71fbzrxytecpsggxywvlgbuyntyefc44ltswbf9k0pgkkcfcsvlluk6x27xl8ykdxw2ch4nnucirrd5ygiqqaen2zh+birmu10o9pzepqxqdirfcjsawlehx7wew+bakjo4qwlxa2vntdihgifhevcv5/sbvxtwtbzrcxjxxiilr6gixpgg9ugvixascejf9mbbdpphte4iwhc8cu1xzbhs/unixvl1tw7lfuikk4wx6y5nmqi5enabn8qvviulefe9drxuvv5vynnymsbwi7az8pvancmbumjmxeok6cts2yta3s4ipa84p/pzgu8shbic4eja1s8sriafalcdw6dqnisokoir5imrxa5mign2mesgsbfwmvqrkym4wndbuhvae7wwizauah+rvbz3actvrkka9cvdzzjhnqjh++dnnsnringf50uau2sg1ryxi4a6skqqq9vsknef6hnauvwja+nlq0dbjg8cbivnslb2lexc+akgsyqsbjecmrb4bpc1gaplhqn04gqfc4cn5wbk+qth4a3ai6v3ijhqa3fl6vghsdhyclcfareovtxqwzhqia78unsvgjscknb2ln383whfhhmmnrfxud8yuajyakytyf8gracqbpmmsnrg3jlf6mbwzfmnfdxkebgm2gom3tdkxm2fmmlr1vn9hcxgydecqiglwgt9hz3utfxnhrqfk59xr0mwi7aqgsrqi3edstqjo/nb9yjob57afqifnyoeqkyobzmdyyhuzgd17jsr2kcncd52vahccuw5ko+wcgzsxj25+adgaocz3j4a+yv8j/9+hjorqjv8qgwsxj1nmkq/hgqo0oe6/lngi4aaye0ccrrh62xwbozextibegrvg36pgv3mtstbvwrcbsxxye2mbkrexyjhpyh9q8/dhrzq0erskfqyrwoxf21hzoomstzfmiriowhbazugfqcrr8baww2dgaovfhyyocsd1crdem5ep6zmknivv96wpqn4b+9rkhzaxl3rpgkrodoiyhveg11n/kfgrk4n136eixvngdwf+dsgiu2wchhqxr36tk1wtnw7pl6rkiltkpo9gupwxbfyx9vh6nbwmri3y/sc4o3dweyriygguptxrbqr6mgmtlzt7x4qeejvszgn4xujp3roc2rvs5lzep4citf52yfnldttfthwxrndp3hufj+42qt9hbd7nka4ai/vru832euq9mia46dexnws0uuwfqes5spw38djphj73hy6xk7c+wdpdokgm7qfx8dnq+ariaa8qi7xkdeak3evuspc+nu45duur5eckhrcyvkbgtervxugltjwflfqrpaa1832/gqtt2h4zcrvfwuvjhtsek3yq3dccyeyquvdtffrkccd7xc1evcfwpt6qzquhsda6kfgu8ahy63gont0lepcvw/cbrg/ocajjb6ruoflpaj8etggohs8lqxzpatibgpsbqitmoq96e9900fgtrkqume8gwd19lf0qcafcbcirbrbnw6/jqjz/v3aydiqp0vnpdvc2tidgt7evdwidcmkruoaa89upz0t1wde1hv72oztx4xan8k37pfg5vyeb1yirkj4imanqpg8+qtvzxlz3tuvz5zvqpvlwkk1gl6qzfoeunoxvvf4nut1whyvjcdnqjdf1uvbwafx84grl9yjmrkiscuinehgupdsrprjywainchuto2zgleg1+ybtpgqi0ba9y1pcbl78dpzhriyrqvcenv2dpdwc1othtuac8nq8y01gv6rrw2jo/ntks5vau5vq+o2oxoccqa4gvdfhksiblosv+zphfmlwatdyc3rbjwl5m1hpvhxxpbecpqh7szu9yctajuxsywbab0sk+1obenvglerzxsxg7gzdxvwoygyhbjzxoxab0mvzdcan43lttq9iuncgqjkdldb6qfucymtxodar4azwm6cygspbiehidtztykd+gy+rbbfbuzzbbt8r6erm3eay5b0ycgjo3ne8coknvtrcyvnwspf4dlgxcd7yzxrlgmbfmsdia14z3wg1yq04p0tzsdwteb9oeud92dlmjo5vqqk7kjjjgcodmnyc430ader+chwaeac4pvrr/eagyoqi7gzx5q4r1bkruq7mgpy6vb88ewbseqxs1smqg7ilotuwjcv+fik8szn9f8esoqwxyrnonvthygsidvzqnm+qmc/l7apco/u7k3yto2zfjg8wzvwzxkhaiusdzhmowqc7w1sn8i5iogsvlkvby4gphljqi9rngi1ehchgmsde4un8p6awi2nkd8apr/g5wd/iv0ftrf38fq8fngj0fnzp6udjlfmt9qzwu3umc5yc59qj+5iv/u9lclvcdw81gxeoaueuq/vk/qq4bpa5v709wrg1tygwx9zciynueuhuyqwjaayszuhvwrhvdvkkvrvklojyn/vpli/pcndg/zrrdiruxlhpfujmaxizpulvujzwzfyp0v1rqwsfvkm/yb81xgz318bfwo/pbrn/lt/z/++zrfjxfx73kz4/zdgwmrtdjupnalligdiljmxtsqinebaxg0mlq80auugyokwmxe2xag0rsdebqyvdzqc5sbg4pyzf7becdrg4p8a3sku5/rwgyoaaaaasuvork5cyii=" } var mychart = echarts.init(document.getelementbyid('main')); //温馨提示:image 选取有严格要求不可过大;,否则firefox不兼容 iconfont上面的图标可以 var maskimage = new image(); maskimage.src = data.image maskimage.onload = function(){ mychart.setoption( { backgroundcolor:'#fff', tooltip: { show: false }, series: [{ type: 'wordcloud', gridsize: 1, sizerange: [12, 55], rotationrange: [-45, 0, 45, 90], maskimage: maskimage, textstyle: { normal: { color: function() { return 'rgb(' + math.round(math.random() * 255) + ', ' + math.round(math.random() * 255) + ', ' + math.round(math.random() * 255) + ')' } } }, left: 'center', top: 'center', // width: '96%', // height: '100%', right: null, bottom: null, // width: 300, // height: 200, // top: 20, data: data.value }] }) } } </script> </body> </html>
运行效果
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
下一篇: 小程序红包雨的实现示例