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 1acba919d..dea94826a 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 @@ -139,13 +139,8 @@ public abstract class AbstractWeekChartFragment extends AbstractChartFragment { entries.add(new PieEntry(value, pieLabels[i])); } - set.setValueTextColor(DESCRIPTION_COLOR); - set.setValueTextSize(13f); - set.setXValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE); - set.setValueFormatter(getPieValueFormatter()); set.setColors(getColors()); - //this hides the values (numeric) added to the set. These would be shown aside the strings set with addXValue above if (totalValues.length < 2) { if (totalValue < mTargetValue) { entries.add(new PieEntry((mTargetValue - totalValue))); @@ -158,6 +153,13 @@ public abstract class AbstractWeekChartFragment extends AbstractChartFragment { if (totalValues.length < 2) { data.setDrawValues(false); } + else { + set.setXValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE); + set.setYValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE); + set.setValueTextColor(DESCRIPTION_COLOR); + set.setValueTextSize(13f); + set.setValueFormatter(getPieValueFormatter()); + } return new DayData(data, formatPieValue((int) totalValue)); }