SamAmco / track-and-graph

An android app for tracking personal data and creating custom graphs
GNU General Public License v3.0
438 stars 40 forks source link

[feature] allow to set graph upper and lower y limit independent #109

Closed stheid closed 3 years ago

stheid commented 3 years ago

Current behaviour

Graphs y limits can be either

Motivation for change

Data that has a one-sided natural bound. When you record body mass you might want to set the lower ylim=0 but the upper limit is can be dynamic to the data

Ideas on implementation

Instead of saving "rangetype" and "bounds" one could express the bounds by nullable doubles. If one bound is null, it is automatically set to the maximum/min of the displayed data, similar to how the dynamic works now.

I would already have made an pullrequest, however i saw that this information is saved in the database and therefore the change would be more severe and one would have to write import logic for legacy code.

The UI-change is straight forward i think

Ideas on Backward compatibility.

Relaxing the bounds to allow nullables is no problem, hence one could easily distinguish old and new data. Converting old data is also fairly simple as one only needs to do the following:

if rangetype == dynamic:
  set bounds null
delete rangetype
stheid commented 3 years ago

Also for this issue i would be happy to implement it if you support the idea.

stheid commented 3 years ago

actually a duplicate of #42