Toggle navigation
进度条式柱图
By
q***d
2020-08-06 09:31:37
脚本
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 peract = [0.333, 0.588, 0.822, 0.666, 0.444]; var hehe = [1, 1, 1, 1, 1, 1]; var daoxu = [6, 5, 4, 3, 2, 1]; var numArr = [{ cum: 50, plan: 70 }, { cum: 40, plan: 49 }, { cum: 50, plan: 55 }, { cum: 60, plan: 62 }, { cum: 80, plan: 83 }, ] option = { backgroundColor: '#000', xAxis: [ // //隐藏x轴刻度 { show: false, }, { show: false, } ], yAxis: { type: 'category', axisLabel: { show: true, color: '#fff', }, // itemStyle: { // show: true // }, // axisTick: { // show: false, //隐藏Y轴刻度 // }, axisLine: { show: false, //隐藏Y轴线段 }, data: ['国网母公司', '国网电科院', '国网河南电力', "国网福建电力", "国网山东电力"], }, grid: { top: '5%', left: '10%', right: '5%', bottom: '5%', // containLabel: true }, series: [ //背景色--------------------------------------------------// { show: true, type: 'bar', barGap: '-90%', barWidth: '40%', //统计条宽度 itemStyle: { normal: { color: 'rgba(23,157,252,0.4)', borderWidth: 1, borderColor: 'rgba(23,157,252,1)', }, }, z: 3, label: { normal: { show: true, // position: ['60%', '30%'], // label 的position位置可以是top bottom left,right,也可以是固定值 // 在这里需要上下统一对齐,所以用固定值 position: ["10%", "40%"], rich: { //富文本 white: { //自定义颜色 color: '#ffffff', fontWeight: "bold" }, whitebold: { color: '#ffffff', fontWeight: "bold", fontSize: 14 }, black: { color: '#000', fontWeight: "bold" }, know: { color: "#02E1E7", fontWeight: "bold", fontSize: 14 } }, formatter: function(data) { if (daoxu[data.dataIndex] == 1) { return "{black| 实际签到: }" + "{whitebold|" + numArr[data.dataIndex].cum + "}" + "{black|人" } else if (daoxu[data.dataIndex] == 2) { return "{black| 实际签到: }" + "{whitebold|" + numArr[data.dataIndex].cum + "}" + "{black|人}" } else if (daoxu[data.dataIndex] == 3) { return "{black| 实际签到: }" + "{whitebold|" + numArr[data.dataIndex].cum + "}" + "{black|人}" } else if (daoxu[data.dataIndex] == 4) { return "{black| 实际签到: }" + "{whitebold|" + numArr[data.dataIndex].cum + "}" + "{black|人}" } else if (daoxu[data.dataIndex] == 5) { return "{black| 实际签到: }" + "{whitebold|" + numArr[data.dataIndex].cum + "}" + "{black|人}" } else if (daoxu[data.dataIndex] == 6) { return "{black| 实际签到: }" + "{whitebold|" + numArr[data.dataIndex].cum + "}" + "{black|人}" } else { return "" } }, } }, data: hehe, }, //蓝条--------------------------------------------------// { show: true, type: 'bar', barGap: '-80%', barWidth: '28%', //统计条宽度 itemStyle: { normal: { color: { type: 'bar', colorStops: [{ offset: 0, color: '#00FBFF' // 0% 处的颜色 }, { offset: 1, color: '#39A7FC' // 100% 处的颜色 }], globalCoord: false, // 缺省为 false }, }, }, // max: 1, label: { normal: { show: true, textStyle: { color: '#fff', //百分比颜色 }, position: "right", rich: { //富文本 white: { //自定义颜色 color: '#ffffff', }, white: { //自定义颜色 color: '#ffffff', fontWeight: "bold" }, whitebold: { color: '#ffffff', fontWeight: "bold", fontSize: 14 }, black: { color: '#000', fontWeight: "bold" }, know: { color: "#02E1E7", fontWeight: "bold", fontSize: 14 } }, //百分比格式 formatter: function(data) { if (daoxu[data.dataIndex] == 1) { return "{white| 应签到: }" + "{know|" + numArr[data.dataIndex].plan + "}" + "{black|人}" } else if (daoxu[data.dataIndex] == 2) { return "{white| 应签到:}" + "{know|" + numArr[data.dataIndex].plan + "}" + "{black|人}" } else if (daoxu[data.dataIndex] == 3) { return "{white| 应签到:}" + "{know|" + numArr[data.dataIndex].plan + "}" + "{black|人}" } else if (daoxu[data.dataIndex] == 4) { return "{white| 应签到:}" + "{know|" + numArr[data.dataIndex].plan + "}" + "{black|人}" } else if (daoxu[data.dataIndex] == 5) { return "{white| 应签到:}" + "{know|" + numArr[data.dataIndex].plan + "}" + "{black|人}" } else if (daoxu[data.dataIndex] == 6) { return "{white| 应签到:}" + "{know|" + numArr[data.dataIndex].plan + "}" + "{black|人}" } else { return "" } }, } }, labelLine: { show: false, }, z: 2, data: peract, }, //数据条--------------------------------------------------// { show: true, type: 'bar', xAxisIndex: 1, //代表使用第二个X轴刻度!!!!!!!!!!!!!!!!!!!!!!!! barGap: '-85%', barWidth: '30%', // // position: ['100%','100%'], itemStyle: { normal: { // barBorderRadius: 200, color: 'rgba(22,203,115,0.05)' // border: }, }, label: { normal: { show: true, position: ['0', '-100%'], rich: { //富文本 white: { //自定义颜色 color: '#ffffff', }, know: { color: "#02E1E7", fontWeight: "bold", fontSize: 14 } }, } }, data: [50, 40, 50, 60, 80] } ] };