option = {
tooltip: {
formatter: function (params) {
return '进度3%';
}
},
angleAxis: {
startAngle: 240,
max: 10,
clockwise: false, // 顺时针
// 隐藏刻度线
show: false
},
radiusAxis: {
type: 'category',
show: true,
axisLabel: {
show: false
},
axisLine: {
show: false
},
axisTick: {
show: false
}
},
polar: {
center: ['50%', '50%'],
radius: '170%' //图形大小
},
series: [
{
stack: '测试',
type: 'bar',
data: [3],
showBackground: true,
backgroundStyle: {
color: '#EFF2F5',
borderColor: '#EFF2F5',
borderWidth: 1
},
coordinateSystem: 'polar',
roundCap: true,
barWidth: 15,
silent: true,
itemStyle: {
normal: {
opacity: 1,
color: {
type: 'linear',
x: 0,
y: 0,
colorStops: [
{
offset: 0,
color: '#D02E2E' // 0% 处的颜色
},
{
offset: 1,
color: '#FFB1B1' // 100% 处的颜色
}
],
global: false // 缺省为 false
},
borderWidth: 3
}
}
},
{
stack: '测试',
type: 'bar',
data: [0.01],
showBackground: true,
backgroundStyle: {
color: '#CFD3DF',
shadowColor: 'rgba(0, 0, 0, 0)',
},
coordinateSystem: 'polar',
roundCap: true,
barWidth: 30,
itemStyle: {
color: '#fff',
borderColor: '#D12F2F',
borderWidth: 5
}
}
]
};
Echarts绘画环形进度条
于 2021-12-23 15:21:23 首次发布