Search in sources :

Example 1 with RealmScatterDataSet

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

the class RealmDatabaseActivityScatter method setData.

private void setData() {
    RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();
    RealmScatterDataSet<RealmDemoData> set = new RealmScatterDataSet<RealmDemoData>(result, "xValue", "yValue");
    set.setLabel("Realm ScatterDataSet");
    set.setScatterShapeSize(9f);
    set.setColor(ColorTemplate.rgb("#CDDC39"));
    set.setScatterShape(ScatterChart.ScatterShape.CIRCLE);
    ArrayList<IScatterDataSet> dataSets = new ArrayList<IScatterDataSet>();
    // add the dataset
    dataSets.add(set);
    // create a data object with the dataset list
    ScatterData data = new ScatterData(dataSets);
    styleData(data);
    // set data
    mChart.setData(data);
    mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
Also used : IScatterDataSet(com.github.mikephil.charting.interfaces.datasets.IScatterDataSet) ArrayList(java.util.ArrayList) RealmScatterDataSet(com.github.mikephil.charting.data.realm.implementation.RealmScatterDataSet) RealmDemoData(com.xxmassdeveloper.mpchartexample.custom.RealmDemoData) ScatterData(com.github.mikephil.charting.data.ScatterData)

Aggregations

ScatterData (com.github.mikephil.charting.data.ScatterData)1 RealmScatterDataSet (com.github.mikephil.charting.data.realm.implementation.RealmScatterDataSet)1 IScatterDataSet (com.github.mikephil.charting.interfaces.datasets.IScatterDataSet)1 RealmDemoData (com.xxmassdeveloper.mpchartexample.custom.RealmDemoData)1 ArrayList (java.util.ArrayList)1