Move to Realm v2.0.2, update example
This commit is contained in:
parent
49b61e92a4
commit
9b7cffa274
3 changed files with 7 additions and 5 deletions
|
@ -56,7 +56,7 @@ repositories {
|
|||
dependencies {
|
||||
//compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
//compile project(':MPChartLib-Realm') // clone "https://github.com/PhilJay/MPAndroidChart-Realm" to get this or uncomment the gradle dependency below:
|
||||
compile 'com.github.PhilJay:MPAndroidChart-Realm:v1.1.0@aar'
|
||||
compile 'com.github.PhilJay:MPAndroidChart-Realm:v2.0.2@aar'
|
||||
|
||||
compile project(':MPChartLib')
|
||||
compile 'com.android.support:appcompat-v7:24.2.1'
|
||||
|
|
|
@ -6,6 +6,7 @@ import android.view.WindowManager;
|
|||
import com.github.mikephil.charting.animation.Easing;
|
||||
import com.github.mikephil.charting.charts.LineChart;
|
||||
import com.github.mikephil.charting.data.LineData;
|
||||
import com.github.mikephil.charting.data.LineDataSet;
|
||||
import com.github.mikephil.charting.data.realm.implementation.RealmLineDataSet;
|
||||
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
|
||||
import com.github.mikephil.charting.utils.ColorTemplate;
|
||||
|
@ -55,13 +56,13 @@ public class RealmDatabaseActivityLine extends RealmBaseActivity {
|
|||
RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();
|
||||
|
||||
RealmLineDataSet<RealmDemoData> set = new RealmLineDataSet<RealmDemoData>(result, "xValue", "yValue");
|
||||
set.setDrawCubic(false);
|
||||
set.setMode(LineDataSet.Mode.CUBIC_BEZIER);
|
||||
set.setLabel("Realm LineDataSet");
|
||||
set.setDrawCircleHole(false);
|
||||
set.setColor(ColorTemplate.rgb("#FF5722"));
|
||||
set.setCircleColor(ColorTemplate.rgb("#FF5722"));
|
||||
set.setLineWidth(1.8f);
|
||||
set.setCircleSize(3.6f);
|
||||
set.setCircleRadius(3.6f);
|
||||
|
||||
ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
|
||||
dataSets.add(set); // add the dataset
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.github.mikephil.charting.charts.LineChart;
|
|||
import com.github.mikephil.charting.components.AxisBase;
|
||||
import com.github.mikephil.charting.data.BarData;
|
||||
import com.github.mikephil.charting.data.LineData;
|
||||
import com.github.mikephil.charting.data.LineDataSet;
|
||||
import com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet;
|
||||
import com.github.mikephil.charting.data.realm.implementation.RealmLineDataSet;
|
||||
import com.github.mikephil.charting.formatter.IAxisValueFormatter;
|
||||
|
@ -100,13 +101,13 @@ public class RealmWikiExample extends RealmBaseActivity {
|
|||
barChart.getXAxis().setValueFormatter(formatter);
|
||||
|
||||
RealmLineDataSet<Score> lineDataSet = new RealmLineDataSet<Score>(results, "scoreNr", "totalScore");
|
||||
lineDataSet.setDrawCubic(false);
|
||||
lineDataSet.setMode(LineDataSet.Mode.CUBIC_BEZIER);
|
||||
lineDataSet.setLabel("Result Scores");
|
||||
lineDataSet.setDrawCircleHole(false);
|
||||
lineDataSet.setColor(ColorTemplate.rgb("#FF5722"));
|
||||
lineDataSet.setCircleColor(ColorTemplate.rgb("#FF5722"));
|
||||
lineDataSet.setLineWidth(1.8f);
|
||||
lineDataSet.setCircleSize(3.6f);
|
||||
lineDataSet.setCircleRadius(3.6f);
|
||||
|
||||
ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
|
||||
dataSets.add(lineDataSet);
|
||||
|
|
Loading…
Add table
Reference in a new issue