1
0
forked from bot/app

feat: 状态卡片模糊半径更改

This commit is contained in:
2024-04-11 13:15:29 +08:00
parent 79451ac24f
commit d37442bc9d
9 changed files with 151 additions and 95 deletions

View File

@ -123,16 +123,30 @@
mottoAuthor.style.textAlign = 'right';
mottoDiv.appendChild(mottoAuthor);
function getPieUsage(data){
let total = 0
let used = 0
data.forEach(item => {
total += item.value
if(item.name === 'FREE'){
used += item.value
}
})
console.log(used, total)
return used / total * 100
}
function getPieOption(title, data) {
return {
animation: false,
title: {
text: title,
text: title + '\n' + getPieUsage(data).toFixed(1) + '%',
left: 'center',
top: 'center',
textStyle: {
//文字颜色
lineHeight: 36,
color: '#fff',
fontSize: 30
}