diff --git a/Web/src/components/Budget/BudgetChartAnalysis.vue b/Web/src/components/Budget/BudgetChartAnalysis.vue index 3b218ed..f50d925 100644 --- a/Web/src/components/Budget/BudgetChartAnalysis.vue +++ b/Web/src/components/Budget/BudgetChartAnalysis.vue @@ -387,10 +387,10 @@ const updateVarianceChart = (chart, budgets) => { type: 'bar', stack: 'Total', barWidth: 20, // Fixed bar width - data: values.map((val, index) => { - // 如果柱子太短(小于15%),文字显示在外部,否则显示在内部 + data: values.map((val) => { + // 如果柱子太短(小于25%),文字显示在外部,否则显示在内部 const ratio = Math.abs(val) / maxVal - const isShort = ratio < 0.15 + const isShort = ratio < 0.25 let position let color @@ -400,6 +400,7 @@ const updateVarianceChart = (chart, budgets) => { position = isShort ? 'left' : 'insideRight' } + // eslint-disable-next-line prefer-const color = isShort ? textColor : '#fff' return {