lecho/hellocharts-android

Labels are now showing

sontqq opened this issue · 0 comments

I am trying to show a piechart with labels at the values without success. I use the code below:

PieChartView pieChartView = findViewById(R.id.chart2);
List<SliceValue> values = new ArrayList<SliceValue>();
values.add(new SliceValue(Float.valueOf(words[1])).setLabel(words[0]).setColor(Color.parseColor(color)));
PieChartData pieChartData = new PieChartData(values);
pieChartView.setPieChartData(pieChartData);
pieChartData.setCenterText1("Recorded data per Device");
pieChartData.setHasCenterCircle(true);
pieChartData.setHasLabels(true);
pieChartData.setHasLabelsOnlyForSelected(true);
pieChartData.setHasLabelsOutside(true);
pieChartView.setValueSelectionEnabled(true);
pieChartData.setValues(values);

Anyone knows why these doesn't show or how to fix that?