Open Priyantha-Kingslake opened 6 months ago
Expected output can be taken by providing a veeery small value for the 1st section (0.000001)
[
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,
),
]
Can you please provide a reproducible code? (a simple main.dart file content)
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.
This problem occurred when --web-renderer html was specified in Flutter web. If --web-renderer html is not shown, there seems to be no problem.
The issue only occurs with PieChartSectionData is 100% of The Pie and the Color has opacity.
PieChart(
PieChartData(
sectionsSpace: 0,
centerSpaceRadius: 18,
sections: [
PieChartSectionData(
color: Theme.of(context).colorScheme.primary.withOpacity(0.5),
radius: 4,
value: 50,
showTitle: false,
),
],
),
);
Result:
Result with Theme.of(context).colorScheme.primary.withOpacity(1),
:
Without opacity the result is as expected
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
value = 0, in 1st section (value > 0 given to 2nd section)
value = 0, in 2nd section (value > 0 given to 1st section)
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