use of com.github.mikephil.charting.data.realm.implementation.RealmPieDataSet in project MPAndroidChart by PhilJay.
the class RealmDatabaseActivityPie method setData.
private void setData() {
RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();
RealmPieDataSet<RealmDemoData> set = new RealmPieDataSet<RealmDemoData>(result, "yValue", "label");
set.setColors(ColorTemplate.VORDIPLOM_COLORS);
set.setLabel("Example market share");
set.setSliceSpace(2);
// create a data object with the dataset list
PieData data = new PieData(set);
styleData(data);
data.setValueTextColor(Color.WHITE);
data.setValueTextSize(12f);
// set data
mChart.setData(data);
mChart.animateY(1400);
}
Aggregations