Toggle navigation
进度条-发光圆点
By
笑***野
2020-10-15 03:01:46
脚本
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
图表已生成
整理代码
刷新
代码
var value = [965,1155,872]; var value1 = [0.65,0.12,-0.33]; var max1 = Math.max.apply(null,value) * 1.2; var data1 = []; //data1存放背景条的数值,for循环使其数量与value一致 for (var i = value.length - 1; i >= 0; i--) { data1.push(max1); }; option = { backgroundColor: '#051F54', grid: { left: "5%", top: "5%", bottom: "5%", right: "5%", containLabel: true }, xAxis: { type: 'value', max : max1, splitLine: { show: false, }, axisLine: { show: false, }, axisTick: { show: false }, axisLabel: { show: false } }, yAxis: { type: 'category', splitLine: { show: false, }, axisLine: { show: false, }, axisTick: { show: false }, axisLabel: { show: true, interval: 0, margin: 0, align: 'left', padding: [-50, 0, 0, 0], textStyle: { color: '#ffffff', fontSize: 16 } }, data : ['周一','周二','周三'] }, series: [{ //真实数值的条形图主体 name: '真实值', type: 'bar', animation: false, barWidth: '5%', label: { show: true, position: 'insideLeft', padding: [50, 0, 0, -15], distance: 15, //color: co1, formatter: function(params) { //console.info(params); if (value1[params.dataIndex] < 0) { return '{a|较上年}{b|' + (value1[params.dataIndex]*100).toFixed(0) + '%}'; } else { return '{a|较上年}{c|+' + (value1[params.dataIndex]*100).toFixed(0) + '%}'; } }, rich: { a: { fontSize: 12, color:'#fff', //padding: [20, -30, 0, -30], }, b: { fontSize: 12, color:'#13C2C2', fontWeight:'bold', padding: [0, 0, 0, 15], }, c: { fontSize: 12, color:'#FF4242', fontWeight:'bold', padding: [0, 0, 0, 15], } } }, itemStyle: { normal: { color: { x: 0, y: 0, x2: 1, y2: 0, colorStops: [{ offset: 0, color: 'rgba(2,50,147,1)' // 0% 处的颜色 }, { offset: 1, color: 'rgba(36,237,255,1)' // 100% 处的颜色 }], } } }, data : value, z:1 }, { //辅助1:真实数值的圆点 name: '真实值圆点', type: 'scatter', symbolOffset: ['10%', '0'], symbolSize: 8, itemStyle: { borderWidth: 0, color: 'rgba(255,255,255,1)' }, data : value, z:5 }, { //辅助2:真实数值的圆点外侧圆环 name: '真实值圆环', type: 'scatter', symbolOffset: ['10%', '0'], symbolSize: 15, itemStyle: { borderWidth: 1, borderColor: 'rgba(101,224,255,1)', //shadowBlur: 15, //shadowColor: 'rgba(101,224,255,1)', color: 'rgba(255,255,255,0.43)' }, data : value, z:10 },{ //辅助3:背景条 name: '背景条', type: 'bar', animation: false, barGap: '-100%', barWidth: '5%', label: { show: true, position: 'insideRight', padding: [-50, -10, 0, 0], distance: 15, color: '#fff', formatter: function(params) { //console.info(params); return ' ' + value[params.dataIndex].toFixed(0); } }, itemStyle: { normal: { color: 'rgba(62,78,123,1)' } }, data : data1, z:0 }] };