博客
关于我
Echarts之symbolSize的大小设置
阅读量:86 次
发布时间:2019-02-25

本文共 875 字,大约阅读时间需要 2 分钟。

symbolSize number, Array, Function

[ default: 4 ]

标记的大小,可以设置成诸如 10 这样单一的数字,也可以用数组分开表示宽和高,例如 [20, 10] 表示标记宽为20,高为10

如果需要每个数据的图形大小不一样,可以设置为如下格式的回调函数:

(value: Array|number, params: Object) => number|Array

其中第一个参数 value 为  中的数据值。第二个参数params 是其它的数据项参数。

所以symbolSize可以全局设置和局部设置两种方式,值的设置方式有两种,单值和双值的形式。

指的方式:

1.单值形式:symbolSize: 4

2.双值形式:symbolSize: 【3,4】 (宽高)

数据的设置的方式区分全局和局部

1.全局

series: {

     symbolSize: 4

}

2.局部

方法一:在data的每一项中去设置 symbolSize

series: [{        data: [{value: 820, symbolSize: 0}, {value: 820, symbolSize: 10}],        symbol:'circle',        smooth: true    }]};

方法二  使用回调函数

var size = [16,0,0,0,8]series: [{         data: [ 820,820,800,900,780,500],        symbol:'circle',        symbolSize:(rawValue, params) => {            params.symbolSize = size[params.dataIndex]            return params.symbolSize        },        type: 'line',        smooth: true    }]

效果图:

你可能感兴趣的文章
Nginx+Keepalived+LVS集群实战
查看>>
Nginx+Keepalived实现简单版高可用主备切换
查看>>
nginx+mysql+redis+mongdb+rabbitmq 自动化部署脚本
查看>>
nginx+php的搭建
查看>>
nginx+tomcat+memcached
查看>>
Nginx+Tomcat实现动静分离
查看>>
nginx+Tomcat性能监控
查看>>
nginx+uwsgi+django
查看>>
nginx+vsftp搭建图片服务器
查看>>
Nginx-http-flv-module流媒体服务器搭建+模拟推流+flv.js在前端html和Vue中播放HTTP-FLV视频流
查看>>
nginx-vts + prometheus 监控nginx
查看>>
Nginx/Apache反向代理
查看>>
Nginx: 413 – Request Entity Too Large Error and Solution
查看>>
nginx: [emerg] getpwnam(“www”) failed 错误处理方法
查看>>
nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:
查看>>
nginx:Error ./configure: error: the HTTP rewrite module requires the PCRE library
查看>>
Nginx:objs/Makefile:432: recipe for target ‘objs/src/core/ngx_murmurhash.o‘解决方法
查看>>
Nginx、HAProxy、LVS
查看>>
Nginx下配置codeigniter框架方法
查看>>
Nginx中使用expires指令实现配置浏览器缓存
查看>>