imaNNeo / fl_chart

FL Chart is a highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart.
https://flchart.dev
MIT License
6.87k stars 1.78k forks source link

Add isMinValueAtCenter property to RadarChartData #1682

Open soraef opened 5 months ago

soraef commented 5 months ago

Summary

This PR adds the isMinValueAtCenter flag to the RadarChartPainter class to allow the minimum value to be centered in the RadarChart.

Related Issues

Changes

isMinValueAtCenter Comparison

isMinValueAtCenter is false isMinValueAtCenter is true
isMinValueAtCenter is false isMinValueAtCenter is true
soraef commented 5 months ago

Thank you for the wonderful product. I use it all the time.

After implementing the changes, I realized that the isMinValueAtCenter flag might not be necessary. Should the minimum value be centered by default? If the current behavior is a bug, it would be better to make the minimum value centered by default instead of adding a flag. This would simplify the code and avoid unnecessary complexity.

imaNNeo commented 5 months ago

Yes I think it is a bug and it should always be centered

soraef commented 1 month ago

I identified a bug where the behavior did not center around zero as expected, so I made corrections. However, I couldn’t get the test to pass. I'm not sure how to adjust the test code to reflect the fix, so I've left it unresolved.