react-native-echarts-wrapper
react-native-echarts-wrapper copied to clipboard
how to avoid pie chart's label out of range?
series: [
{
name: 'mark',
type: 'pie',
radius: ['35%', '60%'],
center: ['50%', '50%'],
smooth: true,
label: {
normal: {
show: false
},
emphasis: {
show: true,
formatter: function (params: any) {
const arry = params.name.split('&')
return arry[0]
},
}
},
labelLine: {
normal: {
show: false
},
emphasis: {
show: true,
}
},
data: this.props.pieData,
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
Question:
“arry[0]” like this "Foreign-currency Time Deposit",
Label may be outside the canvas when it too long , use ("\n") 、("\nn") or ("
") not work , how to fix it ?