use of com.github.mikephil.charting.data.realm.implementation.RealmCandleDataSet 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);
}
Aggregations