Skip to content

Commit 8de70c1

Browse files
Samir Hosny MohamedimaNNeo
authored andcommitted
handle the case of one section has angle 360
1 parent e2f9f9f commit 8de70c1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/src/chart/pie_chart/pie_chart_painter.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,17 @@ class PieChartPainter extends BaseChartPainter<PieChartData> {
454454
final section = data.sections[i];
455455
final sectionAngle = sectionsAngle[i];
456456

457+
if (sectionAngle == 360) {
458+
final distance = math.sqrt(math.pow(localPosition.dx - center.dx, 2) +
459+
math.pow(localPosition.dy - center.dy, 2));
460+
if (distance >= centerRadius &&
461+
distance <= section.radius + centerRadius) {
462+
foundSectionData = section;
463+
foundSectionDataPosition = i;
464+
}
465+
break;
466+
}
467+
457468
final sectionPath = generateSectionPath(
458469
section,
459470
data.sectionsSpace,

0 commit comments

Comments
 (0)