I have the following code:
public class PontuacaoUserActivity extends AppCompatActivity {
PieChart graficoUser;
int pontosCor, pontosNumero, pontosObjeto;
FirebaseUser user;
FirebaseAuth auth;
DatabaseReference databaseRef, userDB;
ArrayList<PieEntry> entries;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Firebase.setAndroidContext(this);
setContentView(R.layout.activity_pontuacao_user);
auth = FirebaseAuth.getInstance();
databaseRef = FirebaseDatabase.getInstance().getReference();
user = auth.getCurrentUser();
userDB = databaseRef.child(user.getUid());
graficoUser = (PieChart) findViewById(R.id.graficoUser);
userDB.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Map<String, String> map = (Map<String, String>) dataSnapshot.getValue();
Log.v("map", map+"");
String username = map.get("username");
String password = map.get("password");
String email = map.get("email");
String pontuacaoObjeto = map.get("pontuacaoObjeto");
String pontuacaoCor = map.get("pontuacaoCor");
String pontuacaoNumero = map.get("pontuacaoNumero");
pontosObjeto = Integer.valueOf(pontuacaoObjeto);
pontosNumero = Integer.valueOf(pontuacaoNumero);
pontosCor = Integer.valueOf(pontuacaoCor);
Log.v("nome: ",email+"");
entries = new ArrayList<>();
entries.add(new PieEntry(pontosCor, "cor"));
entries.add(new PieEntry(pontosNumero, "numero"));
entries.add(new PieEntry(pontosObjeto, "objeto"));
PieDataSet dataset = new PieDataSet(entries, "pontuações");
ArrayList<String> labels = new ArrayList<String>();
labels.add("pontuação da cor");
labels.add("pontuação do numero");
labels.add("pontuação do objeto");
dataset.setLabel(labels.toString());
PieData data = new PieData(dataset);
PieChart chart = new PieChart(getApplicationContext());
setContentView(chart);
chart.setData(data);
chart.setContentDescription("pontuações");
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
I'm not finding good tutorials on the internet that can help me change the color of entries and labels. Help please?
this is the current effect: