文章目录
前言
环形图demo,只是自己留存写过的demo,方便后期项目又类似的时候视觉还原会更快
option = {
tooltip: {
show: true,
// position: 'right',
trigger: 'item',
formatter: `{b}:{c}%`
},
graphic: {
elements: [
{
type: 'image',
style: {
// image: require("../../assets/leader/one.png"),//这里放的是圆圈中的图片
width: 35,
height: 35
},
left: 'center',
top: 'center'
}
]
},
polar: {
radius: ['50%', '80%'],
center: ['50%', '50%']
},
angleAxis: {
max: 100,
show: true,
startAngle: 250
},
radiusAxis: {
type: 'category',
show: true,
axisLabel: {
show: false
},
axisLine: {
show: false
},
axisTick: {
show: false
}
},
series: [
{
type: 'bar',
roundCap: true,
barWidth: 60,
showBackground: true,
backgroundStyle: {
color: 'rgba(255, 255, 255)'
},
data: [{ value: 1048, name: 'Search Engine' }],
coordinateSystem: 'polar',
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'red'
},
{
offset: 1,
color: 'green'
}
])
}
},
label: {
show: true,
formatter: '{b}:{c}%'
}
}
]
};