Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/src/main/org/runnerup/util/GraphWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import android.os.Build;
import android.preference.PreferenceManager;
import android.util.Log;
import android.util.Pair;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
Expand Down Expand Up @@ -104,6 +105,14 @@ public String formatLabel(double value, boolean isValueX) {
graphView2.getViewport().setScalable(true);
graphView2.getViewport().setScrollable(true);

// Get maximum of heart rate and use 110% for y axis
HRZones hrZones = new HRZones(context);
HRZoneCalculator hrZoneCalculator = new HRZoneCalculator(context);
int zoneCount = hrZoneCalculator.getZoneCount();
Pair<Integer, Integer> values = hrZones.getHRValues(zoneCount);

Copy link
Copy Markdown
Collaborator

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.

graphView2.getViewport().setMaxY(values.second*1.1);
graphView2.getViewport().setYAxisBoundsManual(true);

hrzonesBar = new HRZonesBar(context);
}

Expand Down