Search in sources :

Example 1 with RealmRadarDataSet

use of com.github.mikephil.charting.data.realm.implementation.RealmRadarDataSet in project MPAndroidChart by PhilJay.

the class RealmDatabaseActivityRadar method setData.

private void setData() {
    RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();
    //RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "stackValues", "xIndex"); // normal entries
    // stacked entries
    RealmRadarDataSet<RealmDemoData> set = new RealmRadarDataSet<RealmDemoData>(result, "yValue");
    set.setLabel("Realm RadarDataSet");
    set.setDrawFilled(true);
    set.setColor(ColorTemplate.rgb("#009688"));
    set.setFillColor(ColorTemplate.rgb("#009688"));
    set.setFillAlpha(130);
    set.setLineWidth(2f);
    ArrayList<IRadarDataSet> dataSets = new ArrayList<IRadarDataSet>();
    // add the dataset
    dataSets.add(set);
    // create a data object with the dataset list
    RadarData data = new RadarData(dataSets);
    styleData(data);
    // set data
    mChart.setData(data);
    mChart.animateY(1400);
}
Also used : RealmRadarDataSet(com.github.mikephil.charting.data.realm.implementation.RealmRadarDataSet) IRadarDataSet(com.github.mikephil.charting.interfaces.datasets.IRadarDataSet) ArrayList(java.util.ArrayList) RadarData(com.github.mikephil.charting.data.RadarData) RealmDemoData(com.xxmassdeveloper.mpchartexample.custom.RealmDemoData)

Aggregations

RadarData (com.github.mikephil.charting.data.RadarData)1 RealmRadarDataSet (com.github.mikephil.charting.data.realm.implementation.RealmRadarDataSet)1 IRadarDataSet (com.github.mikephil.charting.interfaces.datasets.IRadarDataSet)1 RealmDemoData (com.xxmassdeveloper.mpchartexample.custom.RealmDemoData)1 ArrayList (java.util.ArrayList)1