Merge pull request 'fix:判断图表为0的时候的情况;' (#329) from yangws into main

Reviewed-on: #329
This commit is contained in:
yangws 2024-10-18 09:34:55 +08:00
commit a83cbc2ba2
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ function initChart() {
position: 'top',
formatter: params => {
const value = dataList.value[params.dataIndex].value;
const percentage = ((value / total) * 100).toFixed(); //
const percentage = value ? ((value / total) * 100).toFixed() : 0; //
return `${value}${percentage}%`; //
},
color: '#333',