martykan / forecastie

A simple, opensource weather app for Android.
Other
869 stars 337 forks source link

A very minor graph bug #528

Open robinpaulson opened 4 years ago

robinpaulson commented 4 years ago

The rainfall for today doesn't look scaled correctly, I'd expect the scale to max out at 10, not 12. See attached

robinpaulson commented 4 years ago

robinpaulson commented 4 years ago

The value for the highest peak is 7.9mm.

robinpaulson commented 4 years ago

However, this has very little headroom (11.9mm)

robinpaulson commented 4 years ago

More oddness

robinpaulson commented 4 years ago

@FridoDeluxe I wonder if this bug was was introduced by the updates you did recently in #522? Scrub that, those changes only affected temperature and pressure.

FridoDeluxe commented 4 years ago

This behaviour is not a bug but intended behavior for both rain and wind speed graphs (which have the same calculation algorithm). Unfortunately there are several constraints:

That the graph maximum is 1 to 6, 12, 18 ... is based on the Beafort scale. I was too lazy to include different computations depending on the actual chosen unit, also I wanted to keep the code quite simple. But there are probably better ways to calculate the graph interval, especially for rain where no fixed maximum value is given by a unit.

Currently every graph has its own min/max/gridlines calculation. Maybe it's better to implement one dedicated method that is fed with all the inputs (min, max, unit ...) and returns the perfect graph parameters ... I'll think about it. Although it feels like preparing the icing on the cake, having perfectly fitted graphs without "oddness" is a rewarding goal in my opinion, too.

robinpaulson commented 4 years ago

Although it feels like preparing the icing on the cake, having perfectly fitted graphs without "oddness" is a rewarding goal in my opinion, too.

That was a very detailed answer, thanks Frido. I guess in the grand scheme of things it's perhaps the least buggy bug we could have, it's purely aesthetic and only minor in that sense. Yes, it would be nice to fix, but leaving it for some time is of course not a problem.