一、饼图
const option = {
tooltip: {
trigger: 'item'
},
legend: {
bottom: 10,
itemWidth: 12,
itemHeight: 12,
itemGap: 30,
textStyle: {
color: '#405B84'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '10%',
containLabel: true
},
color: ['#68A0F7', '#64DEF3', '#40CE66', '#F87F4C'],
series: [
{
name: '总数',
type: 'pie',
label: {
color: '#405B84',
formatter: '{b}: {d}%'
},
data: [
{
value: 335,
name: '40分钟以上'
},
{
value: 234,
name: '35-40分钟'
},
{
value: 335,
name: '30-35分钟'
},
{
value: 1234,
name: '30分钟以下'
}
],
radius: '65%'
}
]
};
二、环形图
const option = {
tooltip: {
trigger: 'item'
},
legend: {
bottom: 10,
itemWidth: 12,
itemHeight: 12,
itemGap: 30,
textStyle: {
color: '#405B84'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '10%',
containLabel: true
},
color: ['#68A0F7', '#64DEF3', '#40CE66', '#F87F4C'],
series: [
{
name: '总数',
type: 'pie',
label: {
color: '#405B84',
formatter: '{b}: {d}%'
},
data: [
{
value: 335,
name: '优秀'
},
{
value: 234,
name: '良好'
},
{
value: 335,
name: '合格'
},
{
value: 1234,
name: '较差'
}
],
radius: ['50%', '70%']
}
]
};