echarts占比环形图
作者:互联网
option = {
backgroundColor: 'green',
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)"
},
graphic: {
elements: [
{
type: 'text',
left: 80,
top: 420,
style: {
fill: '#afccf2',
text: ['体育意识'],
font: '14px Arial Normal'
}
},
{
type: 'text',
left: 80,
top: 400,
style: {
fill: '#00ffff',
text: ['36.84分'],
font: '20px Arial Normal'
}
},
{
type: 'text',
left: 305,
top: 420,
style: {
fill: '#afccf2',
text: ['体育知识'],
font: '14px Arial Normal'
}
},
{
type: 'text',
left: 305,
top: 400,
style: {
fill: '#00ffff',
text: ['36.84分'],
font: '20px Arial Normal'
}
},
{
type: 'text',
left: 535,
top: 420,
style: {
fill: '#afccf2',
text: ['体育行为'],
font: '14px Arial Normal'
}
},
{
type: 'text',
left: 535,
top: 400,
style: {
fill: '#00ffff',
text: ['36.84分'],
font: '20px Arial Normal'
}
},
{
type: 'text',
left: 760,
top: 420,
style: {
fill: '#afccf2',
text: ['体育技能'],
font: '14px Arial Normal'
}
},
{
type: 'text',
left: 760,
top: 400,
style: {
fill: '#00ffff',
text: ['36.84分'],
font: '20px Arial Normal'
}
},
{
type: 'text',
left: 1000,
top: 420,
style: {
fill: '#afccf2',
text: ['体育健康'],
font: '14px Arial Normal'
}
},
{
type: 'text',
left: 1000,
top: 400,
style: {
fill: '#00ffff',
text: ['36.84分'],
font: '20px Arial Normal'
}
}
]
},
series: [
{
name: '体育意识',
type: 'pie',
radius: ['13%', '15%'],
center:['10%','50%'],
avoidLabelOverlap: false,
color: [new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#cefd73'
},
{
offset: 0.5,
color: '#79ec86'
},{
offset: 1,
color: '#24da98'
}]), 'rgba(235,235,235,0.2)'],
label: {
normal: {
show: false,
position: 'center'
},
emphasis: {
show: false,
}
},
labelLine: {
normal: {
show: false
}
},
data: [
{
value: 70, name: '体育意识',
label: {
normal: {
show: false,
},
position: 'center'
}
},
{value: 120, name: '总分1'}
]
},
{
name: '体育知识',
type: 'pie',
radius: ['13%', '15%'],
center:['30%','50%'],
avoidLabelOverlap: false,
color: [new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#83fbfc'
},
{
offset: 0.5,
color: '#6bdafe'
},{
offset: 1,
color: '#52b9ff'
}]), 'rgba(235,235,235,0.2)'],
label: {
normal: {
show: false,
position: 'right'
},
emphasis: {
show: false,
}
},
labelLine: {
normal: {
show: false
}
},
data: [
{
value: 170, name: '体育知识',
label: {
normal: {
show: false,
}
}
},
{value: 310, name: '总分2'}
]
},
{
name: '体育行为',
type: 'pie',
radius: ['13%', '15%'],
center:['50%','50%'],
avoidLabelOverlap: false,
color: [new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#fff283'
},
{
offset: 1,
color: '#ff6e17'
}]), 'rgba(235,235,235,0.2)'],
label: {
normal: {
show: false,
position: 'right'
},
emphasis: {
show: false,
}
},
labelLine: {
normal: {
show: false
}
},
data: [
{
value: 130, name: '体育行为',
label: {
normal: {
show: false,
}
}
},
{value: 310, name: '总分3'}
]
},
{
name: '体育技能',
type: 'pie',
radius: ['13%', '15%'],
center:['70%','50%'],
avoidLabelOverlap: false,
color: [new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#abdeff'
},
{
offset: 1,
color: '#5a52ff'
}]), 'rgba(235,235,235,0.2)'],
label: {
normal: {
show: false,
position: 'right'
},
emphasis: {
show: false,
}
},
labelLine: {
normal: {
show: false
}
},
data: [
{
value: 180, name: '体育技能',
label: {
normal: {
show: false,
}
}
},
{value: 310, name: '总分4'}
]
},
{
name: '体育健康',
type: 'pie',
radius: ['13%', '15%'],
center:['90%','50%'],
avoidLabelOverlap: false,
color: [new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#ffc9bd'
},{
offset: 1,
color: '#ff6f6f'
}]), 'rgba(235,235,235,0.2)'],
label: {
normal: {
show: false,
position: 'right'
},
emphasis: {
show: false,
}
},
labelLine: {
normal: {
show: false
}
},
data: [
{
value: 150, name: '体育健康',
label: {
normal: {
show: false,
}
}
},
{value: 310, name: '总分5'}
]
}
]
};
标签:false,name,show,color,text,环形,type,echarts 来源: https://blog.csdn.net/qq_40576178/article/details/123245068