Skip to content

Commit 6084b81

Browse files
committed
Fixed issue that caused LineChart to crash.
1 parent c0d263c commit 6084b81

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ protected void drawData() {
133133
LineDataSet dataSet = dataSets.get(i);
134134
ArrayList<Entry> entries = dataSet.getYVals();
135135

136+
if (entries.size() < 1)
137+
continue;
138+
136139
mRenderPaint.setStrokeWidth(dataSet.getLineWidth());
137140
mRenderPaint.setPathEffect(dataSet.getDashPathEffect());
138141

@@ -240,7 +243,7 @@ && isOffContentBottom(valuePoints[j + 1]))
240243

241244
Path line = generateLinePath(entries);
242245
transformPath(line);
243-
246+
244247
mDrawCanvas.drawPath(line, mRenderPaint);
245248
}
246249

@@ -303,7 +306,7 @@ private Path generateFilledPath(ArrayList<Entry> entries, float fillMin) {
303306

304307
return filled;
305308
}
306-
309+
307310
/**
308311
* Generates the path that is used for drawing a single line.
309312
*

0 commit comments

Comments
 (0)