imaNNeo / imaNNeo/fl_chart

PieChart centerSpace disapearing

Open
#1,617 5 comments 0 reactions 0 assignees View on GitHub
Needs Reproducible Code Pie Chart
Dominant language
Dart
Stars
7.6k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
2

Description

I have a pieChart with only 2 sections where the section values are calculated dynamically.
I saw that the innerCircle disappears when the first section's value is 0.
I tested with switching the values, i.e. first section has a value and second section value = 0, then the bug is not there, the innerCircle is drawn as normal.
(PieChartSectionData radius and PieChartData centerSpaceRadius is been given explicitly in all instances)

**Steps to Reproduce**
create a PieChart with 2 PieChartSectionData( ) in sections parameter.
provide value = 0 to first section and any value to 2nd section

**Screenshots**
When values provided to both sections
![image](https://github.com/imaNNeo/fl_chart/assets/125013689/007a8cdf-d8ba-408e-8bf5-d531690fa28a)

value = 0, in 1st section (value > 0 given to 2nd section)
![image](https://github.com/imaNNeo/fl_chart/assets/125013689/2a2bb353-cda2-4763-b35f-64b1abef3900)

value = 0, in 2nd section (value > 0 given to 1st section)
![image](https://github.com/imaNNeo/fl_chart/assets/125013689/1a925471-edaf-45e4-8164-34c7039d1d16)

### Versions
**flutter version**
Flutter 3.19.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ba39319843 (3 weeks ago) • 2024-03-07 15:22:21 -0600
Engine • revision 2e4ba9c6fb
Tools • Dart 3.3.1 • DevTools 2.31.1

**fl_chart version**
fl_chart: ^0.66.2

FYI: I didn't check behavior with any other number of sections

Contributor guide

Open the contributing guide

Research direction

Start by locating the PieChart rendering entry point and any tests covering PieChartSectionData values or centerSpaceRadius. Reproduce the two-section case with a zero first value, then compare it with the reversed values. Done means the inner circle remains visible in both cases, with a regression test covering the zero-first-section scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.