-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get maximum of heart rate and use 110% for y axis of heart rate graph #873
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If max is set, min must be set too.
However, I do not find the presentation better with just the zone max/min.
Limiting max min if exceeding the zones could be useful, to filter uninteresting bad values. Was that what you really tried to do here?
Crash as well.
Please provide screenshots as well in an updated version.
HRZones hrZones = new HRZones(context); | ||
HRZoneCalculator hrZoneCalculator = new HRZoneCalculator(context); | ||
int zoneCount = hrZoneCalculator.getZoneCount(); | ||
Pair<Integer, Integer> values = hrZones.getHRValues(zoneCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If no zone is set, this will return null, must add a check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The presentation if below the low zone just looks like a bug to users.
This from a walking activity, not the primary use of RU, but still a use case.
If zones are not setup, the presentation is a little stretched out:
Presenting zero values should be considered a bug. This is how nozone presentation look after changing that:
This could be made a configurable, but RU has enough configurations already.
Therefore, I propose that the max/min are set to the zones that match them. This should give you reasonable comparable graphs but with better resolution. If lower zone is 0, use min value instead of 0, but crop max values.
Pair<Integer, Integer> MaxValues = hrZones.getHRValues(zoneCount); | ||
Pair<Integer, Integer> MinValues = hrZones.getHRValues(1); | ||
if(MaxValues != null && MinValues != null){ | ||
graphView2.getViewport().setMaxY(MaxValues.second*1.1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be set in complete()
The maximum of the heart rate graph in the detail view was set by the graphview. I changed it to 110% of the maximum heart rate from settings. Now the graph is better scaled.