Skip to content

Commit 35faecc

Browse files
committed
Added dialog for example that the feature drawing into the chart by gesture is currenlty not available.
1 parent 81b883f commit 35faecc

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,13 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
222222
tvY.setText("" + (mSeekBarY.getProgress()));
223223

224224
ArrayList<String> xVals = new ArrayList<String>();
225-
for (int i = 0; i < mSeekBarX.getProgress(); i++) {
225+
for (int i = 0; i < mSeekBarX.getProgress()+1; i++) {
226226
xVals.add(mMonths[i % 12]);
227227
}
228228

229229
ArrayList<Entry> yVals1 = new ArrayList<Entry>();
230230

231-
for (int i = 0; i < mSeekBarX.getProgress(); i++) {
231+
for (int i = 0; i < mSeekBarX.getProgress()+1; i++) {
232232
float mult = (mSeekBarY.getProgress() + 1);
233233
float val = (float) (Math.random() * mult) + 3;
234234
yVals1.add(new Entry(val, i));

MPChartExample/src/com/xxmassdeveloper/mpchartexample/notimportant/MainActivity.java

+10-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
package com.xxmassdeveloper.mpchartexample.notimportant;
33

44
import android.app.Activity;
5+
import android.app.AlertDialog;
56
import android.content.Context;
67
import android.content.Intent;
78
import android.net.Uri;
@@ -22,7 +23,6 @@
2223
import com.xxmassdeveloper.mpchartexample.AnotherBarActivity;
2324
import com.xxmassdeveloper.mpchartexample.BarChartActivity;
2425
import com.xxmassdeveloper.mpchartexample.BarChartActivityMultiDataset;
25-
import com.xxmassdeveloper.mpchartexample.DrawChartActivity;
2626
import com.xxmassdeveloper.mpchartexample.InvertedLineChartActivity;
2727
import com.xxmassdeveloper.mpchartexample.LineChartActivity;
2828
import com.xxmassdeveloper.mpchartexample.ListViewBarChartActivity;
@@ -48,7 +48,7 @@ protected void onCreate(Bundle savedInstanceState) {
4848

4949
// initialize the utilities
5050
Utils.init(getResources());
51-
51+
5252
ArrayList<ContentItem> objects = new ArrayList<ContentItem>();
5353

5454
objects.add(new ContentItem("Line Chart", "A simple demonstration of the linechart."));
@@ -126,8 +126,14 @@ public void onItemClick(AdapterView<?> av, View v, int pos, long arg3) {
126126
startActivity(i);
127127
break;
128128
case 8:
129-
i = new Intent(this, DrawChartActivity.class);
130-
startActivity(i);
129+
// i = new Intent(this, DrawChartActivity.class);
130+
// startActivity(i);
131+
132+
AlertDialog.Builder b = new AlertDialog.Builder(this);
133+
b.setTitle("Feature not available");
134+
b.setMessage("Due to recent changes to the data model of the library, this feature is temporarily not available.");
135+
b.setPositiveButton("OK", null);
136+
b.create().show();
131137
break;
132138
case 9:
133139
i = new Intent(this, SimpleChartDemo.class);

MPChartLib/src/com/github/mikephil/charting/charts/Chart.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,8 @@ protected void drawMarkers() {
10091009

10101010
int xIndex = mIndicesToHightlight[i].getXIndex();
10111011

1012-
drawMarkerView(xIndex, mIndicesToHightlight[i].getDataSetIndex());
1012+
if (xIndex < mCurrentData.getXVals().size())
1013+
drawMarkerView(xIndex, mIndicesToHightlight[i].getDataSetIndex());
10131014
}
10141015
}
10151016

0 commit comments

Comments
 (0)