echarts饼图让部分数据显示在图外,部分显示在图内
var dataList = [
{ value: 10, name: '商户' },
{ value: 20, name: '充电桩' },
{ value: 30, name: '业主' }
]
option = {
series: [
{
type: 'pie',
radius: '70%',
data: dataList,
labelLine: {
show: true,
position: 'outside',
length: 10,
length2: 50
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
label: {
normal: {
position: 'outside',
formatter: (params) => {
return params.data.name+'-'+params.data.value
}
}
}
},
{
type: 'pie',
radius: '70%',
data: dataList,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
label: {
normal: {
position: 'inside',
show: true,
formatter: '{b}'
}
}
}
]
};