Get maximum of heart rate and use 110% for y axis of heart rate graph#873
Get maximum of heart rate and use 110% for y axis of heart rate graph#873vanseforge wants to merge 2 commits into
Conversation
gerhardol
left a comment
There was a problem hiding this comment.
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.
If no zone is set, this will return null, must add a check.
There was a problem hiding this comment.
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.
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.