Java 类com.github.mikephil.charting.data.realm.implementation.RealmPieDataSet 实例源码

项目:GitHub    文件:RealmDatabaseActivityPie.java   
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);
    }
项目:Stayfit    文件:RealmDatabaseActivityPie.java   
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class);

        //RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "stackValues", "xIndex"); // normal entries
        RealmPieDataSet<RealmDemoData> set = new RealmPieDataSet<RealmDemoData>(result, "value", "xIndex"); // stacked entries
        set.setColors(ColorTemplate.VORDIPLOM_COLORS);
        set.setLabel("Example market share");
        set.setSliceSpace(2);

        // create a data object with the dataset list
        RealmPieData data = new RealmPieData(result, "xValue", set);
        styleData(data);
        data.setValueTextColor(Color.WHITE);
        data.setValueTextSize(12f);

        // set data
        mChart.setData(data);
        mChart.animateY(1400);
    }
项目:xs-android-architecture    文件:RealmDatabaseActivityPie.java   
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);
    }
项目:MPAndroidChart    文件:RealmDatabaseActivityPie.java   
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);
    }