Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PieChart centerSpace disapearing #1617

Open
Priyantha-Kingslake opened this issue Mar 26, 2024 · 3 comments
Open

PieChart centerSpace disapearing #1617

Priyantha-Kingslake opened this issue Mar 26, 2024 · 3 comments

Comments

@Priyantha-Kingslake
Copy link

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

value = 0, in 1st section (value > 0 given to 2nd section)
image

value = 0, in 2nd section (value > 0 given to 1st section)
image

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

@Priyantha-Kingslake
Copy link
Author

Expected output can be taken by providing a veeery small value for the 1st section (0.000001)
image

    [
      PieChartSectionData(
        showTitle: false,
        value: totalHours == 0 ? 0.000001 : totalHours,
        color: MyColors.kBlue,
        radius: radius,
      ),
      PieChartSectionData(
        showTitle: false,
        value: remaining,
        color: MyColors.kBlue.withOpacity(0.2),
        radius: radius,
      ),
    ]

@imaNNeo
Copy link
Owner

imaNNeo commented May 8, 2024

Can you please provide a reproducible code? (a simple main.dart file content)

@Priyantha-Kingslake
Copy link
Author

Tried with minimum possible and the bug didn't occur.
Issue's still there in the original.
Will try to find cause
Bit busy these days though...
Will update here when I get some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants