Search in sources :

Example 11 with RealmDemoData

use of com.xxmassdeveloper.mpchartexample.custom.RealmDemoData 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)

Example 12 with RealmDemoData

use of com.xxmassdeveloper.mpchartexample.custom.RealmDemoData 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)

Example 13 with RealmDemoData

use of com.xxmassdeveloper.mpchartexample.custom.RealmDemoData in project MPAndroidChart by PhilJay.

the class RealmDatabaseActivityCandle method setData.

private void setData() {
    RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();
    RealmCandleDataSet<RealmDemoData> set = new RealmCandleDataSet<RealmDemoData>(result, "xValue", "high", "low", "open", "close");
    set.setLabel("Realm CandleDataSet");
    set.setShadowColor(Color.DKGRAY);
    set.setShadowWidth(0.7f);
    set.setDecreasingColor(Color.RED);
    set.setDecreasingPaintStyle(Paint.Style.FILL);
    set.setIncreasingColor(Color.rgb(122, 242, 84));
    set.setIncreasingPaintStyle(Paint.Style.STROKE);
    set.setNeutralColor(Color.BLUE);
    ArrayList<ICandleDataSet> dataSets = new ArrayList<ICandleDataSet>();
    // add the dataset
    dataSets.add(set);
    // create a data object with the dataset list
    CandleData data = new CandleData(dataSets);
    styleData(data);
    // set data
    mChart.setData(data);
    mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
Also used : ICandleDataSet(com.github.mikephil.charting.interfaces.datasets.ICandleDataSet) CandleData(com.github.mikephil.charting.data.CandleData) ArrayList(java.util.ArrayList) RealmCandleDataSet(com.github.mikephil.charting.data.realm.implementation.RealmCandleDataSet) RealmDemoData(com.xxmassdeveloper.mpchartexample.custom.RealmDemoData)

Aggregations

RealmDemoData (com.xxmassdeveloper.mpchartexample.custom.RealmDemoData)13 ArrayList (java.util.ArrayList)7 BarData (com.github.mikephil.charting.data.BarData)2 RealmBarDataSet (com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet)2 IBarDataSet (com.github.mikephil.charting.interfaces.datasets.IBarDataSet)2 BubbleData (com.github.mikephil.charting.data.BubbleData)1 CandleData (com.github.mikephil.charting.data.CandleData)1 LineData (com.github.mikephil.charting.data.LineData)1 PieData (com.github.mikephil.charting.data.PieData)1 RadarData (com.github.mikephil.charting.data.RadarData)1 ScatterData (com.github.mikephil.charting.data.ScatterData)1 RealmBubbleDataSet (com.github.mikephil.charting.data.realm.implementation.RealmBubbleDataSet)1 RealmCandleDataSet (com.github.mikephil.charting.data.realm.implementation.RealmCandleDataSet)1 RealmLineDataSet (com.github.mikephil.charting.data.realm.implementation.RealmLineDataSet)1 RealmPieDataSet (com.github.mikephil.charting.data.realm.implementation.RealmPieDataSet)1 RealmRadarDataSet (com.github.mikephil.charting.data.realm.implementation.RealmRadarDataSet)1 RealmScatterDataSet (com.github.mikephil.charting.data.realm.implementation.RealmScatterDataSet)1 IBubbleDataSet (com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet)1 ICandleDataSet (com.github.mikephil.charting.interfaces.datasets.ICandleDataSet)1 ILineDataSet (com.github.mikephil.charting.interfaces.datasets.ILineDataSet)1