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>(); dataSets.add(set); // add the dataset // 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); }
private void setData() { RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class); RealmCandleDataSet<RealmDemoData> set = new RealmCandleDataSet<RealmDemoData>(result, "high", "low", "open", "close", "xIndex"); set.setLabel("Realm 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>(); dataSets.add(set); // add the dataset // create a data object with the dataset list RealmCandleData data = new RealmCandleData(result, "xValue", dataSets); styleData(data); // set data mChart.setData(data); mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart); }