实现效果
代码
option = {
color: '#3dc886',
series: [
{
type: 'gauge',
radius: '100%',
min: 0,
max: 100,
progress: {
show: true,
width: 15
},
axisLine: {
lineStyle: {
width: 15
}
},
axisTick: {
show: false
},
axisLabel:{
fontSize: 9,
color: '#0c0c0c',
show: true,
formatter: function (val) {
//解决刻度的值为浮点数问题
return Math.ceil(val);
},
},
splitLine: {
length: 15,
lineStyle: {
width: 2,
color: '#70a0f1'
}
},
anchor: {
show: true,
showAbove: true,
size: 16,
itemStyle: {
borderWidth: 10
}
},
title: {
show: false
},
detail: {
valueAnimation: true,
fontSize: 30,
offsetCenter: [0, '70%']
},
itemStyle: {
color: '#70a0f1'
},
pointer: {
length: '70%',
width: 8,
},
data: [{
value: 40,
color: '#3dc886'
}]
}
]
};
查看效果地址:
将内容复制到在左边的参数栏