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

preventCurveOverShooting sounds like mitigation rather than solution #1648

Open chris-rutkowski opened 6 months ago

chris-rutkowski commented 6 months ago

Hey, amazing plugin, please don't get me wrong with this issue.

There are a lot of issues that include the keyword preventCurveOverShooting. It is always suggested to the problem that can be seen on the picture (taken from one of the issues):

Screenshot 2024-05-01 at 9 06 43 PM

But I don't think it is a solution. While it's nice to have a control over "roundness", there shouldn't be preventCurveOverShooting+preventCurveOvershootingThreshold as there shouldn't be any over shooting in the first place. Chart shouldn't display data that doesn't exist.

Those bumps are buggy and glitchy. aboveBarData and belowBarData doesn't colour them when they are rendered beyond bounds. The issue https://github.com/imaNNeo/fl_chart/issues/25 has been closed, despite glitch reported there by @jamesblasco - line has inconsistent thickness when those prevent... are toggled on.

Once again, amazing work, love your plugin, but would kindly appreciate reconsidering this implementation. We just want round lines, not zigzags :)

TobiasRump commented 6 months ago

Yeah it would be a really good idea, to have the preventCurveOverShooting = true as default.

Here is again a user from today, who is confused

https://github.com/imaNNeo/fl_chart/issues/1649

cedvdb commented 2 weeks ago

@imaNNeo

Curves are fine. The issue is problematic when the curve goes below a bottom or above an upper bound.

For instance if you have 0% and 100%, it does not make sense to have the line go beyond those two bounds.

Same if you are displaying sales per hour:

image

Prevent curve overshooting does not have the expected effect:

image

The curves are less smooth

Imo a better solution would be to have bounds for the data so it does not go beyond those bounds.

What do you think ?