got the following code:
Legend legend = mChart.getLegend();
legend.setLabels(new String[]{\"aaaaa\", \"bbbbb\", \"ccccc\"});
This s
Pass the label name as second parameter to constructor PieEntry()
.
(For version > 3.0.0)
Example:
ArrayList yvalues = new ArrayList();
yvalues.add(new PieEntry(8f, "JAN"));
yvalues.add(new PieEntry(15f, "FEB"));
yvalues.add(new PieEntry(12f, "MAR"));
yvalues.add(new PieEntry(25f, "APR"));
yvalues.add(new PieEntry(23f, "MAY"));
yvalues.add(new PieEntry(17f, "JUNE"));
PieDataSet dataSet = new PieDataSet(yvalues, "Election Results");
PieData data = new PieData();
data.addDataSet(dataSet);
data.setValueFormatter(new PercentFormatter());
pieChart.setData(data);