From 769bfef7160c770c1e8b218bda5a37fc6ab34834 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 25 Jun 2024 17:01:24 +0800 Subject: [PATCH 1/2] fix(pie): Missing pie chart label display. close #20070 --- src/chart/pie/labelLayout.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chart/pie/labelLayout.ts b/src/chart/pie/labelLayout.ts index 934b49cadc..4736a4b937 100644 --- a/src/chart/pie/labelLayout.ts +++ b/src/chart/pie/labelLayout.ts @@ -89,7 +89,7 @@ function adjustSingleSide( const rA = r + item.len; const rA2 = rA * rA; // Use ellipse implicit function to calculate x - const dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2); + const dx = Math.sqrt(Math.abs((1 - Math.abs(dy * dy / rB2)) * rA2)); const newX = cx + (dx + item.len2) * dir; const deltaX = newX - item.label.x; const newTargetWidth = item.targetTextWidth - deltaX * dir; From 403dce221e5b368e44b402a4491bab137e414d35 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 9 Jul 2024 17:39:45 +0800 Subject: [PATCH 2/2] fix(pie): fix some labels may not show #20074 --- src/chart/pie/labelLayout.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chart/pie/labelLayout.ts b/src/chart/pie/labelLayout.ts index 4736a4b937..5052ca236b 100644 --- a/src/chart/pie/labelLayout.ts +++ b/src/chart/pie/labelLayout.ts @@ -89,7 +89,7 @@ function adjustSingleSide( const rA = r + item.len; const rA2 = rA * rA; // Use ellipse implicit function to calculate x - const dx = Math.sqrt(Math.abs((1 - Math.abs(dy * dy / rB2)) * rA2)); + const dx = Math.sqrt(Math.abs((1 - dy * dy / rB2) * rA2)); const newX = cx + (dx + item.len2) * dir; const deltaX = newX - item.label.x; const newTargetWidth = item.targetTextWidth - deltaX * dir;