From f48729cc64bf90e38a7300f5fb96e6c0cbc96783 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Wed, 5 Apr 2017 00:08:17 +0200 Subject: [PATCH] Pie Charts: some improvements wrt the labels Still room for optimization. Thanks to Alberto! --- .../activities/charts/AbstractWeekChartFragment.java | 3 +++ .../gadgetbridge/activities/charts/SleepChartFragment.java | 4 ++++ 2 files changed, 7 insertions(+) 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 ea55e740e..1acba919d 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,6 +139,9 @@ 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()); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/SleepChartFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/SleepChartFragment.java index 67b53c4a0..d5dd746b2 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/SleepChartFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/SleepChartFragment.java @@ -105,6 +105,10 @@ public class SleepChartFragment extends AbstractChartFragment { } }); set.setColors(colors); + set.setValueTextColor(DESCRIPTION_COLOR); + set.setValueTextSize(13f); + set.setXValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE); + set.setYValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE); data.setDataSet(set); //setupLegend(pieChart);