From 77897a8101cb42022034e4bdb4d094aab1c4e592 Mon Sep 17 00:00:00 2001 From: CaIon Date: Wed, 8 Apr 2026 15:57:26 +0800 Subject: [PATCH] feat(dashboard): enhance chart axes and update sorting logic --- web/src/hooks/dashboard/useDashboardCharts.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/hooks/dashboard/useDashboardCharts.jsx b/web/src/hooks/dashboard/useDashboardCharts.jsx index d101a6c5..0d138350 100644 --- a/web/src/hooks/dashboard/useDashboardCharts.jsx +++ b/web/src/hooks/dashboard/useDashboardCharts.jsx @@ -319,6 +319,12 @@ export const useDashboardCharts = ( text: t('用户消耗趋势'), subtext: '', }, + axes: [{ + orient: 'left', + label: { + formatMethod: (value) => renderQuota(value, 2), + }, + }], area: { style: { fillOpacity: 0.15 } }, line: { style: { lineWidth: 2 } }, point: { visible: false }, @@ -513,7 +519,7 @@ export const useDashboardCharts = ( User: item.User, rawQuota: item.Quota, Quota: getQuotaWithUnit(item.Quota, 4), - })).sort((a, b) => a.rawQuota - b.rawQuota); + })).sort((a, b) => b.rawQuota - a.rawQuota); const totalUserQuota = rankingData.reduce((s, i) => s + i.Quota, 0);