Toggle navigation
双圆环
By
b***n
2020-12-28 07:15:26
脚本
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
图表已生成
整理代码
刷新
代码
let numWjc = 2; //未解除数字 let numYjc = 1; //已解除数字 let allNum = numWjc + numYjc; //中间数字 let pieData1 = []; //小圆 有颜色部分 let pieData2 = []; //小圆 背景 let pieNum = 90; let yjcOutColor = "#BA1F26"; //已解除颜色 外部圆环 let wjcOutColor = "#FF6971"; //未解除颜色 外部圆环 let innerCircleBg = "#1e313a" //内部圆环背景 let innerCircleActiveStart = "#59AF33" //内部圆环 渐变开始 let innerCircleActiveEnd = "#AFFF8C" //内部圆环 渐变结束 let innerRadius = ["30%", "42%"] let outRadius = ["72%", "57%"] for (let i = 0; i < pieNum; ++i) { pieData1.push({ value: 1, name: i, itemStyle: { normal: { color: i < (pieNum * numYjc) / allNum ? new echarts.graphic.LinearGradient( 0, 0, 0, 1, [{ offset: 0, color: innerCircleActiveStart, }, { offset: 1, color: innerCircleActiveEnd, }, ] ) : "rgba(0,209,228,0)", }, }, }); } for (let i = 0; i < pieNum; ++i) { pieData2.push({ value: 1, name: i, itemStyle: { normal: { color: "#638F7F", }, }, }); } option = { title: [{ text: allNum, x: "48%", y: "40%", textAlign: "center", textStyle: { fontSize: "43", fontWeight: "900", color: "#77FFC4", textAlign: "center", }, }, ], polar: { radius: outRadius, center: ["50%", "50%"], }, angleAxis: { show: false, max: allNum, }, radiusAxis: { type: "category", show: true, axisLabel: { show: false, }, axisLine: { show: false, }, axisTick: { show: false, }, }, tooltip: { show: false, }, calculable: true, series: [{ // 外圈 name: "", type: "bar", // roundCap: true, barWidth: 60, showBackground: true, backgroundStyle: { color: "#638F7F", }, data: [numYjc], coordinateSystem: "polar", itemStyle: { normal: { color: new echarts.graphic.LinearGradient( 0, 1, 0, 0, [{ offset: 0, color: yjcOutColor, }, { offset: 1, color: wjcOutColor, }, ] ), }, }, }, { // 小圆 有颜色部分 hoverAnimation: false, type: "pie", z: 2, data: pieData1, radius: innerRadius, zlevel: -2, itemStyle: { normal: { borderColor: innerCircleBg, borderWidth: 1, }, }, label: { normal: { position: "inside", show: false, }, }, }, { // 小圆 背景 竖条 hoverAnimation: false, type: "pie", z: 1, data: pieData2, radius: innerRadius, zlevel: -2, itemStyle: { normal: { borderColor: "#1e313a", borderWidth: 1, }, }, label: { show: false, }, }, ], };