Fix potential race condition when counted steps are above the daily target.
Also added a few comments wrt the labels and the values of the pie chart.
This commit is contained in:
parent
3ed4856bf6
commit
27669761bf
|
@ -113,15 +113,20 @@ public class WeekStepsChartFragment extends AbstractChartFragment {
|
|||
|
||||
entries.add(new Entry(totalSteps, 0));
|
||||
colors.add(akActivity.color);
|
||||
//we don't want labels on the pie chart
|
||||
data.addXValue("");
|
||||
|
||||
if (totalSteps < mTargetSteps) {
|
||||
entries.add(new Entry((mTargetSteps - totalSteps), 1));
|
||||
colors.add(Color.GRAY);
|
||||
//we don't want labels on the pie chart
|
||||
data.addXValue("");
|
||||
}
|
||||
|
||||
PieDataSet set = new PieDataSet(entries, "");
|
||||
set.setColors(colors);
|
||||
data.setDataSet(set);
|
||||
//this hides the values (numeric) added to the set. These would be shown aside the strings set with addXValue above
|
||||
data.setDrawValues(false);
|
||||
pieChart.setData(data);
|
||||
|
||||
|
|
Loading…
Reference in New Issue