Skip to content

Commit 43bc45b

Browse files
committed
Minor fixes in example
1 parent 87193a3 commit 43bc45b

File tree

9 files changed

+13
-10
lines changed

9 files changed

+13
-10
lines changed

MPChartExample/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ buildscript {
3737
jcenter()
3838
}
3939
dependencies {
40-
classpath 'com.android.tools.build:gradle:2.0.0'
40+
classpath 'com.android.tools.build:gradle:2.1.0'
4141
//classpath 'io.realm:realm-gradle-plugin:0.88.2'
4242
// NOTE: Do not place your application dependencies here; they belong
4343
// in the individual module build.gradle files

MPChartExample/src/com/xxmassdeveloper/mpchartexample/AnotherBarActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,9 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
206206
BarData data = new BarData(xVals, dataSets);
207207

208208
mChart.setData(data);
209-
mChart.invalidate();
210209
}
210+
211+
mChart.invalidate();
211212
}
212213

213214
@Override

MPChartExample/src/com/xxmassdeveloper/mpchartexample/CubicLineChartActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ private void setData(int count, float range) {
290290
set1 = (LineDataSet)mChart.getData().getDataSetByIndex(0);
291291
set1.setYVals(yVals);
292292
mChart.getData().setXVals(xVals);
293+
mChart.getData().notifyDataChanged();
293294
mChart.notifyDataSetChanged();
294295
} else {
295296
// create a dataset and give it a type

MPChartExample/src/com/xxmassdeveloper/mpchartexample/LineChartActivity1.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ private void setData(int count, float range) {
349349
float mult = (range + 1);
350350
float val = (float) (Math.random() * mult) + 3;// + (float)
351351
// ((mult *
352-
// 0.1) / 10);
352+
// 0.1) / 10);x
353353
yVals.add(new Entry(val, i));
354354
}
355355

@@ -360,6 +360,7 @@ private void setData(int count, float range) {
360360
set1 = (LineDataSet)mChart.getData().getDataSetByIndex(0);
361361
set1.setYVals(yVals);
362362
mChart.getData().setXVals(xVals);
363+
mChart.getData().notifyDataChanged();
363364
mChart.notifyDataSetChanged();
364365
} else {
365366
// create a dataset and give it a type

MPChartExample/src/com/xxmassdeveloper/mpchartexample/LineChartActivity2.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ private void setData(int count, float range) {
319319
set1.setYVals(yVals1);
320320
set2.setYVals(yVals2);
321321
mChart.getData().setXVals(xVals);
322+
mChart.getData().notifyDataChanged();
322323
mChart.notifyDataSetChanged();
323324
} else {
324325
// create a dataset and give it a type
@@ -352,8 +353,8 @@ private void setData(int count, float range) {
352353
//set2.setFillFormatter(new MyFillFormatter(900f));
353354

354355
ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
355-
dataSets.add(set2);
356356
dataSets.add(set1); // add the datasets
357+
dataSets.add(set2);
357358

358359
// create a data object with the datasets
359360
LineData data = new LineData(xVals, dataSets);

MPChartExample/src/com/xxmassdeveloper/mpchartexample/ListViewBarChartActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
112112

113113
// do not forget to refresh the chart
114114
// holder.chart.invalidate();
115-
holder.chart.animateY(700, Easing.EasingOption.EaseInCubic);
115+
holder.chart.animateY(700);
116116

117117
return convertView;
118118
}

MPChartExample/src/com/xxmassdeveloper/mpchartexample/MultiLineChartActivity.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ protected void onCreate(Bundle savedInstanceState) {
5757
mChart.setDescription("");
5858
mChart.setDrawBorders(false);
5959

60-
mChart.getAxisLeft().setDrawAxisLine(false);
61-
mChart.getAxisLeft().setDrawGridLines(false);
60+
mChart.getAxisLeft().setEnabled(false);
6261
mChart.getAxisRight().setDrawAxisLine(false);
6362
mChart.getAxisRight().setDrawGridLines(false);
6463
mChart.getXAxis().setDrawAxisLine(false);

MPChartExample/src/com/xxmassdeveloper/mpchartexample/ScatterChartActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
195195
set1.setColor(ColorTemplate.COLORFUL_COLORS[0]);
196196
ScatterDataSet set2 = new ScatterDataSet(yVals2, "DS 2");
197197
set2.setScatterShape(ScatterShape.CIRCLE);
198-
set2.setScatterShapeHoleColor(Color.WHITE);
199-
set2.setScatterShapeHoleRadius(5f);
198+
set2.setScatterShapeHoleColor(ColorTemplate.COLORFUL_COLORS[3]);
199+
set2.setScatterShapeHoleRadius(4f);
200200
set2.setColor(ColorTemplate.COLORFUL_COLORS[1]);
201201
ScatterDataSet set3 = new ScatterDataSet(yVals3, "DS 3");
202202
set3.setScatterShape(ScatterShape.CROSS);

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:2.0.0'
10+
classpath 'com.android.tools.build:gradle:2.1.0'
1111
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
1212
}
1313
}

0 commit comments

Comments
 (0)