Skip to content

Commit 9b7cffa

Browse files
committed
Move to Realm v2.0.2, update example
1 parent 49b61e9 commit 9b7cffa

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

MPChartExample/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ repositories {
5656
dependencies {
5757
//compile fileTree(dir: 'libs', include: ['*.jar'])
5858
//compile project(':MPChartLib-Realm') // clone "https://github.com/PhilJay/MPAndroidChart-Realm" to get this or uncomment the gradle dependency below:
59-
compile 'com.github.PhilJay:MPAndroidChart-Realm:v1.1.0@aar'
59+
compile 'com.github.PhilJay:MPAndroidChart-Realm:v2.0.2@aar'
6060

6161
compile project(':MPChartLib')
6262
compile 'com.android.support:appcompat-v7:24.2.1'

MPChartExample/src/com/xxmassdeveloper/mpchartexample/realm/RealmDatabaseActivityLine.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.github.mikephil.charting.animation.Easing;
77
import com.github.mikephil.charting.charts.LineChart;
88
import com.github.mikephil.charting.data.LineData;
9+
import com.github.mikephil.charting.data.LineDataSet;
910
import com.github.mikephil.charting.data.realm.implementation.RealmLineDataSet;
1011
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
1112
import com.github.mikephil.charting.utils.ColorTemplate;
@@ -55,13 +56,13 @@ private void setData() {
5556
RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();
5657

5758
RealmLineDataSet<RealmDemoData> set = new RealmLineDataSet<RealmDemoData>(result, "xValue", "yValue");
58-
set.setDrawCubic(false);
59+
set.setMode(LineDataSet.Mode.CUBIC_BEZIER);
5960
set.setLabel("Realm LineDataSet");
6061
set.setDrawCircleHole(false);
6162
set.setColor(ColorTemplate.rgb("#FF5722"));
6263
set.setCircleColor(ColorTemplate.rgb("#FF5722"));
6364
set.setLineWidth(1.8f);
64-
set.setCircleSize(3.6f);
65+
set.setCircleRadius(3.6f);
6566

6667
ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
6768
dataSets.add(set); // add the dataset

MPChartExample/src/com/xxmassdeveloper/mpchartexample/realm/RealmWikiExample.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.github.mikephil.charting.components.AxisBase;
1010
import com.github.mikephil.charting.data.BarData;
1111
import com.github.mikephil.charting.data.LineData;
12+
import com.github.mikephil.charting.data.LineDataSet;
1213
import com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet;
1314
import com.github.mikephil.charting.data.realm.implementation.RealmLineDataSet;
1415
import com.github.mikephil.charting.formatter.IAxisValueFormatter;
@@ -100,13 +101,13 @@ public int getDecimalDigits() {
100101
barChart.getXAxis().setValueFormatter(formatter);
101102

102103
RealmLineDataSet<Score> lineDataSet = new RealmLineDataSet<Score>(results, "scoreNr", "totalScore");
103-
lineDataSet.setDrawCubic(false);
104+
lineDataSet.setMode(LineDataSet.Mode.CUBIC_BEZIER);
104105
lineDataSet.setLabel("Result Scores");
105106
lineDataSet.setDrawCircleHole(false);
106107
lineDataSet.setColor(ColorTemplate.rgb("#FF5722"));
107108
lineDataSet.setCircleColor(ColorTemplate.rgb("#FF5722"));
108109
lineDataSet.setLineWidth(1.8f);
109-
lineDataSet.setCircleSize(3.6f);
110+
lineDataSet.setCircleRadius(3.6f);
110111

111112
ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
112113
dataSets.add(lineDataSet);

0 commit comments

Comments
 (0)