在echarts3中使用字符云
echarts2的官方API里是带有字符云的,但到了echarts3就被从官网上移除了,想要使用的话可以从github上下载:
下载地址:https://github.com/ecomfe/echarts-wordcloud
使用方法:
1.依次引入echarts.min.js和echarts-wordcloud.min.js(文件位置:下载的压缩包下dist/echarts-wordcloud.min.js);
<script src="echarts.min.js"></script> <script src="echarts-wordcloud.min.js"></script>
2.自己翻译的简易说明(供参考)
width---字符云画布宽度
height---字符云画布宽度
maskImage---剪影图像,白色区域将被排除在绘图文本之外,形状选项将继续应用为云的形状。
如:
var maskImage = new Image(); //var world_option = world_cloud(eval('(' + '${cloud}' + ')'),maskImage); var world_option = world_cloud(data,maskImage); maskImage.onload = function () { world_option.series[0].maskImage worldChart.setOption(world_option); } maskImage.src = 'img/ren1.png';
gridSize---字符之间的间距(int)
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 45 rotationRange: [-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,// Global text style textStyle: {normal: {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: {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 text textStyle: {normal: {},emphasis: {}}}]}] });
转载于:https://www.cnblogs.com/Smiled/p/7146550.html
在echarts3中使用字符云相关推荐
- vue字符云-------把老婆放到云端
老规矩,先上老婆图 没错,这就是我老婆,由于图片太大,一再压缩,效果也不是特别好,所以暂时用图标代替吧,毕竟还是图标好用,下面说一下如何自定义不同形状的字符云 比如这种 首先当然要先在项目中添加字符云 ...
- Echarts3之字符云WorldCloud
字符云功能现在已经不在Echarts的官方示例中了.通过官网里面也找不到对应的API和具体介绍. 如果需要进行开发的话需要单独引用专门的js文件. 下面是下载的百度云链接:worldcloud.js ...
- Echarts3之字符云按照给定形状显示
上篇说到Echarts引入字符云,但是只是单独的显示随机的排列图形. 下面又找了一个可以自定义字符云整体显示的操作. 首先你需要一张想要显示的矢量图. 然后代码方面: function world_c ...
- xrkmonitor监控mysql_xrkmonitor字符云监控系统
下面我们对xrkmonitor字符云监控系统文件阐述相关使用资料和xrkmonitor字符云监控系统文件的更新信息. xrkmonitor字符云监控系统 xrkmonitor字符云监控系统是一个国产开 ...
- 云控系统php源码,xrkmontor字符云监控系统php源码 v2.5
xrkmontor xrkmontor字符云监控系统特色: 1.IP地址库: 支持通过IP地址上报时将IP地址转为物理地址,相同物理地址归并展示一个监控API 即可轻松生成监控数据的物理地址分布图,插 ...
- Java web:基于jieba分词器(或ansj分词器)的文章关键词字符云(词云图)
上来先丢一个展示图,吸引一下注意力(跑. 上图为对某论文用jieba分词后,计算其逆文档频率(TF-IDF)作为权重,并用echarts的字符云扩展包echarts-wordcloud画出来的字符云图 ...
- java字符乱码问题_怎么解决java中的字符乱码问题
怎么解决java中的字符乱码问题 发布时间:2020-06-28 14:53:09 来源:亿速云 阅读:108 作者:Leah 怎么解决java中的字符乱码问题?相信很多没有经验的人对此束手无策,为此 ...
- echarts字符云相关配置说明
4.9版本字符云相关配置项 字段 字段说明 type 类型wordCloud gridSize 网格大小,各项之间的间距 shape 图表形状,一般分为 circle 圆,cardioid 心, di ...
- 【实时数仓】Day06-数据可视化接口:接口介绍、Sugar大屏、成交金额、不同维度交易额(品牌、品类、商品spu)、分省的热力图 、新老顾客流量统计、字符云...
一.数据可视化接口介绍 1.设计思路 后把轻度聚合的结果保存到 ClickHouse 中后,提供即时的查询.统计.分析 展现形式:用于数据分析的BI工具[商业智能(Business Intellige ...
最新文章
- No rule to make target ‘../../libxxx_lib.so‘
- 【数据竞赛】ICCV 2021 竞赛汇总
- Jerry的反省:程序员不要轻易说出“这个功能技术上无法实现“
- linux下gdb常用的调试命令
- Redhat Enterprise Linux 6 正式版已经发布!
- 研究人员发现针对印度军队的网络间谍活动
- 苹果公司发布TestFlight Groups,放宽二进制版本提交限制
- springboot 建readme_README
- paip.HTML文本框INPUT无法输入的解决
- 深圳云计算培训:专科生学习云计算就业前景如何?
- EurekaCAP原理
- 注意力机制详解(小白入门)
- windows 安装pyenv做python环境控制(极其简单)
- java与模式(一)
- Windows系统提示“telnet不是内部或外部命令,也不是可运行的程序或批处理文件”怎么办?
- 如何开通微信支付和支付宝支付0.2%(千分之二)费率(最全攻略)
- 国内可用的css,js,图标字体,等常用前端公共库CDN服务
- XML注入:实战篇--MCIR的XMLmao模块0~1
- Vue 随笔1-加入vue router 后发现app被渲染了2次
- 汽车导航linux系统设计,基于ARM-Linux平台车载导航系统设计与实现
热门文章
- 【STM32】程序下载(ST-LINK V2)
- 【STM32】error unknown register name vfpcc in asm的解决方法
- 【Linux】一步一步学Linux——od命令(266)
- 学习python的基础是什么_学python需要什么基础
- blob html 预览_本地图片预览+blob使用
- html中判断字段第一位,javascript判断字符串是否相等
- python基础类型,Python基础-类
- 打家劫舍—leetcode198
- 模型占用GPU显存计算
- CF-1147D Palindrome XOR (建图划分等价类)