From f42ee9cf67dc0ed06bc657061fa40f04eccbb8a4 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 2 Nov 2025 01:12:14 +0800 Subject: [PATCH] hide total amount divider line in trend charts when no items are displayed --- src/components/desktop/MonthlyTrendsChart.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/desktop/MonthlyTrendsChart.vue b/src/components/desktop/MonthlyTrendsChart.vue index 18acfe68..52ea4c18 100644 --- a/src/components/desktop/MonthlyTrendsChart.vue +++ b/src/components/desktop/MonthlyTrendsChart.vue @@ -316,6 +316,7 @@ const chartOptions = computed(() => { formatter: (params: CallbackDataParams[]) => { let tooltip = ''; let totalAmount = 0; + let actualDisplayItemCount = 0; const displayItems: MonthlyTrendsChartTooltipItem[] = []; for (const param of params) { @@ -343,12 +344,13 @@ const chartOptions = computed(() => { tooltip += '
'; tooltip += `${item.name}${value}
`; tooltip += '
'; + actualDisplayItemCount++; } } if (props.showTotalAmountInTooltip) { const displayTotalAmount = formatAmountToLocalizedNumeralsWithCurrency(totalAmount, props.defaultCurrency); - tooltip = '
' + tooltip = (actualDisplayItemCount > 0 ? '
' : '
') + '' + `${tt('Total Amount')}${displayTotalAmount}
` + '
' + tooltip;