echarts实现渐变环形
var option = {
title: {
text: "达标",
x: "center",
y: "center",
textStyle: {
fontWeight: "normal",
color: "#29EEF3",
fontSize: "14",
},
},
polar: {
radius: ["75%", "90%"],
center: ['50%', '50%'],
},
angleAxis: {
max: 100,
show: false,
startAngle:225,//极坐标开始角度
},
radiusAxis: {
type: 'category',
show: true,
axisLabel: {
show: false,
},
axisLine: {
show: false,
},
axisTick: {
show: false,
},
},
series: [
{
name: '',
type: 'bar',
roundCap: true,
barWidth: 30,
backgroundStyle: {
color: 'rgba(66, 66, 66, .3)',
},
data: [75],
coordinateSystem: 'polar',
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
{
offset: 0,
color: '#16CEB9',
},
{
offset: 1,
color: '#6648FF',
},
]),
},
},
},
],
};