From 58d8603078c7ec0e94c649c7b834b29028db9ad4 Mon Sep 17 00:00:00 2001 From: Rishyanth Kondra <55177765+rishyanthkondra@users.noreply.github.com> Date: Sat, 24 Jan 2026 16:43:38 +0530 Subject: [PATCH 1/2] [BugFix] Rose chart (area roseType) angles not uniform when end angle is not auto Update angle condition for sector recalculation. 2*PI is default, but when end angle is not auto and span is < 2PI, this will not work. Issue: rose chart (roseType=area) angles are not uniform anymore --- src/chart/pie/pieLayout.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chart/pie/pieLayout.ts b/src/chart/pie/pieLayout.ts index 937f129c76..7b891b6d1b 100644 --- a/src/chart/pie/pieLayout.ts +++ b/src/chart/pie/pieLayout.ts @@ -165,7 +165,7 @@ export default function pieLayout( // Some sector is constrained by minAngle and padAngle // Rest sectors needs recalculate angle - if (restAngle < PI2 && validDataCount) { + if (restAngle < angleRange && validDataCount) { // Average the angle if rest angle is not enough after all angles is // Constrained by minAngle and padAngle if (restAngle <= 1e-3) { From 654e1b397d15a46cbda1d203cbae65a6ae9f6616 Mon Sep 17 00:00:00 2001 From: Rishyanth Kondra <55177765+rishyanthkondra@users.noreply.github.com> Date: Sun, 25 Jan 2026 11:11:22 +0530 Subject: [PATCH 2/2] [Bug fix] do not recompute equal angles in area rose chart Rose chart > `area` type breaks with start and end angles --- src/chart/pie/pieLayout.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/chart/pie/pieLayout.ts b/src/chart/pie/pieLayout.ts index 7b891b6d1b..2da9decd5e 100644 --- a/src/chart/pie/pieLayout.ts +++ b/src/chart/pie/pieLayout.ts @@ -118,20 +118,18 @@ export default function pieLayout( if (roseType !== 'area') { angle = (sum === 0 && stillShowZeroSum) ? unitRadian : (value * unitRadian); + if (angle < minAndPadAngle) { + angle = minAndPadAngle; + restAngle -= minAndPadAngle; + } + else { + valueSumLargerThanMinAngle += value; + } } else { angle = angleRange / validDataCount; } - - if (angle < minAndPadAngle) { - angle = minAndPadAngle; - restAngle -= minAndPadAngle; - } - else { - valueSumLargerThanMinAngle += value; - } - const endAngle = currentAngle + dir * angle; // calculate display angle @@ -165,7 +163,7 @@ export default function pieLayout( // Some sector is constrained by minAngle and padAngle // Rest sectors needs recalculate angle - if (restAngle < angleRange && validDataCount) { + if (restAngle < PI2 && validDataCount && roseType !== 'area') { // Average the angle if rest angle is not enough after all angles is // Constrained by minAngle and padAngle if (restAngle <= 1e-3) {