Search in sources :

Example 1 with RealmBubbleDataSet

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

the class RealmDatabaseActivityBubble method setData.

private void setData() {
    RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();
    RealmBubbleDataSet<RealmDemoData> set = new RealmBubbleDataSet<RealmDemoData>(result, "xValue", "yValue", "bubbleSize");
    set.setLabel("Realm BubbleDataSet");
    set.setColors(ColorTemplate.COLORFUL_COLORS, 110);
    ArrayList<IBubbleDataSet> dataSets = new ArrayList<IBubbleDataSet>();
    // add the dataset
    dataSets.add(set);
    // create a data object with the dataset list
    BubbleData data = new BubbleData(dataSets);
    styleData(data);
    // set data
    mChart.setData(data);
    mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
Also used : IBubbleDataSet(com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet) BubbleData(com.github.mikephil.charting.data.BubbleData) RealmBubbleDataSet(com.github.mikephil.charting.data.realm.implementation.RealmBubbleDataSet) ArrayList(java.util.ArrayList) RealmDemoData(com.xxmassdeveloper.mpchartexample.custom.RealmDemoData)

Aggregations

BubbleData (com.github.mikephil.charting.data.BubbleData)1 RealmBubbleDataSet (com.github.mikephil.charting.data.realm.implementation.RealmBubbleDataSet)1 IBubbleDataSet (com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet)1 RealmDemoData (com.xxmassdeveloper.mpchartexample.custom.RealmDemoData)1 ArrayList (java.util.ArrayList)1