fix
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 39s
Docker Build & Deploy / Deploy to Production (push) Successful in 19s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 2s

This commit is contained in:
SunCheng
2026-01-17 15:03:19 +08:00
parent 2043976998
commit 0ef4b52fcc
4 changed files with 44 additions and 19 deletions

View File

@@ -331,6 +331,7 @@ const updateVarianceChart = (chart, budgets) => {
const categories = data.map(item => item.name)
const values = data.map(item => item.value)
const maxVal = Math.max(...values.map(v => Math.abs(v))) || 1
const textColor = getCssVar('--van-text-color')
const splitLineColor = getCssVar('--chart-split')
@@ -387,11 +388,25 @@ const updateVarianceChart = (chart, budgets) => {
stack: 'Total',
barWidth: 20, // Fixed bar width
data: values.map((val, index) => {
// 如果柱子太短小于15%),文字显示在外部,否则显示在内部
const ratio = Math.abs(val) / maxVal
const isShort = ratio < 0.15
let position
let color
if (val >= 0) {
position = isShort ? 'right' : 'insideLeft'
} else {
position = isShort ? 'left' : 'insideRight'
}
color = isShort ? textColor : '#fff'
return {
value: val,
label: {
position: val >= 0 ? 'insideLeft' : 'insideRight',
color: '#fff'
position: position,
color: color
}
}
}),
@@ -522,8 +537,8 @@ const updateBurndownChart = () => {
data: dates,
axisLabel: {
color: axisLabelColor,
interval: Math.ceil(daysInMonth / 8) - 1,
rotate: 45
interval: 'auto',
rotate: 0
},
splitLine: { show: false },
axisLine: {