Skip to content

Commit b8ce47a

Browse files
committed
Fixed dataset updates in demos
1 parent fcd696a commit b8ce47a

9 files changed

Lines changed: 9 additions & 0 deletions

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
192192
mChart.getData().getDataSetCount() > 0) {
193193
set1 = (BarDataSet)mChart.getData().getDataSetByIndex(0);
194194
set1.setYVals(yVals1);
195+
mChart.getData().setXVals(xVals);
195196
mChart.notifyDataSetChanged();
196197
} else {
197198
set1 = new BarDataSet(yVals1, "Data Set");

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ private void setData(int count, float range) {
252252
mChart.getData().getDataSetCount() > 0) {
253253
set1 = (BarDataSet)mChart.getData().getDataSetByIndex(0);
254254
set1.setYVals(yVals1);
255+
mChart.getData().setXVals(xVals);
255256
mChart.notifyDataSetChanged();
256257
} else {
257258
set1 = new BarDataSet(yVals1, "DataSet");

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
221221
set1.setYVals(yVals1);
222222
set2.setYVals(yVals2);
223223
set3.setYVals(yVals3);
224+
mChart.getData().setXVals(xVals);
224225
mChart.notifyDataSetChanged();
225226
} else {
226227
// create 3 datasets with different types

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ private void setData(int count) {
230230
mChart.getData().getDataSetCount() > 0) {
231231
set = (BarDataSet)mChart.getData().getDataSetByIndex(0);
232232
set.setYVals(entries);
233+
mChart.getData().setXVals(xVals);
233234
mChart.notifyDataSetChanged();
234235
} else {
235236
set = new BarDataSet(entries, "Sinus Function");

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

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ private void setData(int count, float range) {
248248
mChart.getData().getDataSetCount() > 0) {
249249
set1 = (BarDataSet)mChart.getData().getDataSetByIndex(0);
250250
set1.setYVals(yVals1);
251+
mChart.getData().setXVals(xVals);
251252
mChart.notifyDataSetChanged();
252253
} else {
253254
set1 = new BarDataSet(yVals1, "DataSet 1");

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ private void setData(int count, float range) {
359359
mChart.getData().getDataSetCount() > 0) {
360360
set1 = (LineDataSet)mChart.getData().getDataSetByIndex(0);
361361
set1.setYVals(yVals);
362+
mChart.getData().setXVals(xVals);
362363
mChart.notifyDataSetChanged();
363364
} else {
364365
// create a dataset and give it a type

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ private void setData(int count, float range) {
318318
set2 = (LineDataSet)mChart.getData().getDataSetByIndex(1);
319319
set1.setYVals(yVals1);
320320
set2.setYVals(yVals2);
321+
mChart.getData().setXVals(xVals);
321322
mChart.notifyDataSetChanged();
322323
} else {
323324
// create a dataset and give it a type

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
208208
mChart.getData().getDataSetCount() > 0) {
209209
set1 = (BarDataSet)mChart.getData().getDataSetByIndex(0);
210210
set1.setYVals(yVals1);
211+
mChart.getData().setXVals(xVals);
211212
mChart.notifyDataSetChanged();
212213
} else {
213214
set1 = new BarDataSet(yVals1, "Statistics Vienna 2014");

0 commit comments

Comments
 (0)