fix:判断图表为0的时候的情况; #329

Merged
yangws merged 1 commits from yangws into main 2024-10-18 09:34:57 +08:00
1 changed files with 1 additions and 1 deletions
Showing only changes of commit a521010392 - Show all commits

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',