From c2668d2e6c4b6c856aa1d17fd1ba2f9b40162e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Sat, 12 Oct 2024 19:00:26 +0100 Subject: [PATCH] Add average line to HR chart --- .../charts/HeartRateDailyFragment.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/HeartRateDailyFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/HeartRateDailyFragment.java index 6c58a14c3..83bdb3a24 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/HeartRateDailyFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/HeartRateDailyFragment.java @@ -1,5 +1,6 @@ package nodomain.freeyourgadget.gadgetbridge.activities.charts; +import android.graphics.Color; import android.os.Build; import android.os.Bundle; import android.view.LayoutInflater; @@ -13,6 +14,7 @@ import androidx.core.content.ContextCompat; import com.github.mikephil.charting.charts.Chart; import com.github.mikephil.charting.charts.LineChart; import com.github.mikephil.charting.components.LegendEntry; +import com.github.mikephil.charting.components.LimitLine; import com.github.mikephil.charting.components.XAxis; import com.github.mikephil.charting.components.YAxis; import com.github.mikephil.charting.data.Entry; @@ -187,6 +189,21 @@ public class HeartRateDailyFragment extends AbstractChartFragment 0) { + // final LimitLine restingLine = new LimitLine(data.restingHeartRate); + // restingLine.setLineWidth(1.5f); + // restingLine.enableDashedLine(15f, 10f, 0f); + // restingLine.setLineColor(Color.GRAY); + // hrLineChart.getAxisLeft().addLimitLine(restingLine); + //} } protected static class HeartRateData extends ChartsData {