Toggle navigation
圆环图没有labelLine
By
c***6
2020-02-12 16:30:29
脚本
16
21
作品使用的第三方脚本
数据管理
上传数据
支持小于 5M 任意格式(csv, xlsx, json, xml, ...)的数据文件
上传后可以通过生成的文件链接异步获取托管的数据。
历史数据
0 条
无历史数据
代码修改记录
信息提示
保存作品
对当前截图不满意?你还可以
上传本地截图
重新截图
作品名称
作品描述
标签
geo
grid
legend
markLine
markPoint
bar
effectScatter
line
lines
map
timeline
title
toolbox
tooltip
visualMap
作品默认版本
最新
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
20:11:45
图表已生成
整理代码
刷新
代码
option = { backgroundColor: 'rgba(0,0,0,1)', // tooltip: { // trigger: 'item', // formatter: "{b} : {d}%
{c}" // }, title: { text: '8', subtext: '万吨', x: 'center', y: '43%', textStyle: { fontSize: 80, fontWeight: 'bolder', color: 'orange', }, subtextStyle: { fontSize: 28, fontWeight: 'normal', align:"center", color:'white' }, }, series: [{ type: 'pie', radius: ['140', '180'], center: ['50%', '50%'], // 实际代码中写在这里不会触发,要写入 itemStyle 中 color:function(params){ console.log(params.value); var colorList = ['#1ed5ed', '#1ea8ed', '#1e80ed', '#ffe100','#1eede2']; return (params.value)?colorList[params.dataIndex]:"white"; }, // color: ['#1ed5ed', '#1ea8ed', '#1e80ed', '#ffe100','#1eede2','#1eede2','#1eede2'], data: [ { value: 25, name: '5G智慧医疗' }, { value: 25, name: '人工智能医疗' }, { value: 33, name: '远程医疗' }, { value: 17, name: '医疗云计算' }, { value: 0, name: '移动健康应用' }, { value: 0, name: '移动健康应用1' }, { value: 0, name: '移动健康应用1' } ], labelLine: { normal: { length: 10, length2: 230, show: true, lineStyle: { width: 1, } }, emphasis: { show: false, } }, label: { // 有两种状态,一种是normal,一种高亮 emphasis normal: { padding: [0, -220, 0, -220], // 备注一下,b是数据项名称也就 data.name, c是数据项数值也就是data.value, d是数据项百分比 // formatter: '{b|{b}}\n{hr|}\n{c|{c}%}', // hr是下底线 // formatter:'{d|{d}%}\n{b|{b}}', formatter:'{b|{b}} {d|{d}%}\n\n\n\n', // 值得注意下, 不在这里设定 color, 系统也会自动将色环颜色 // 赋值给文本,不需要额外指定. // 额外指定之后 emphasis 就会出现问题 rich: { b: { fontSize: 32, color: 'white', align: 'center', padding: 0, }, // hr: { // borderColor: function(){ // return "red"; // }, // width: '100%', // borderWidth: 4, // height: 1, // }, d: { fontSize: 32, align: 'left', padding: 0, } }, }, emphasis: { formatter:'{d|{d}%}\n{b|{b}}\n\n{hr|}', rich: { b: { fontSize: 32, color: 'white', align: 'center', padding: 0, }, hr: { borderColor: 'yellow', width: '100%', borderWidth: 4, height: 1 }, d: { fontSize: 32, align: 'left', padding: 0, } } } } } ] };