diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractWeekChartFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractWeekChartFragment.java index 182026133..546f03ca3 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractWeekChartFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractWeekChartFragment.java @@ -147,7 +147,12 @@ public abstract class AbstractWeekChartFragment extends AbstractActivityChartFra barData.setValueTextColor(Color.GRAY); //prevent tearing other graph elements with the black text. Another approach would be to hide the values cmpletely with data.setDrawValues(false); barData.setValueTextSize(10f); + barChart.getAxisLeft().setAxisMaximum(Math.max(set.getYMax(), mTargetValue) + 60); + LimitLine target = new LimitLine(mTargetValue); + target.setLineWidth(1.5f); + target.enableDashedLine(15f, 10f, 0f); + target.setLineColor(getResources().getColor(R.color.chart_deep_sleep_dark)); barChart.getAxisLeft().removeAllLimitLines(); barChart.getAxisLeft().addLimitLine(target); @@ -156,6 +161,8 @@ public abstract class AbstractWeekChartFragment extends AbstractActivityChartFra average = Math.abs(balance / TOTAL_DAYS_FOR_AVERAGE); } LimitLine average_line = new LimitLine(average); + average_line.setLineWidth(1.5f); + average_line.enableDashedLine(15f, 10f, 0f); average_line.setLabel(getString(R.string.average, getAverage(average))); if (average > (mTargetValue)) { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/StepsDailyFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/StepsDailyFragment.java index 5e7526893..85a709284 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/StepsDailyFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/StepsDailyFragment.java @@ -25,7 +25,6 @@ import com.github.mikephil.charting.components.YAxis; import com.github.mikephil.charting.data.Entry; import com.github.mikephil.charting.data.LineData; import com.github.mikephil.charting.data.LineDataSet; -import com.github.mikephil.charting.formatter.ValueFormatter; import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; import org.slf4j.Logger; @@ -34,10 +33,7 @@ import org.slf4j.LoggerFactory; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; -import java.util.Date; import java.util.List; -import java.util.Locale; -import java.util.TimeZone; import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.R; @@ -144,10 +140,6 @@ public class StepsDailyFragment extends StepsFragment lineDataSets = new ArrayList<>(); lineDataSets.add(lineDataSet); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/StepsPeriodFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/StepsPeriodFragment.java index d5c54d8ff..639a3fa98 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/StepsPeriodFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/StepsPeriodFragment.java @@ -112,10 +112,11 @@ public class StepsPeriodFragment extends StepsFragment