From a0b1ab83e75d2175133c16208c2e099d5fb5fe37 Mon Sep 17 00:00:00 2001 From: Daniel Cohen Gindi Date: Thu, 1 Oct 2015 18:25:45 +0300 Subject: [PATCH] Avoid trying to draw cubic fill when there's no points More info: https://github.com/danielgindi/ios-charts/issues/419 --- .../github/mikephil/charting/renderer/LineChartRenderer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MPChartLib/src/com/github/mikephil/charting/renderer/LineChartRenderer.java b/MPChartLib/src/com/github/mikephil/charting/renderer/LineChartRenderer.java index 186b925d39..913ed47fba 100644 --- a/MPChartLib/src/com/github/mikephil/charting/renderer/LineChartRenderer.java +++ b/MPChartLib/src/com/github/mikephil/charting/renderer/LineChartRenderer.java @@ -237,6 +237,9 @@ protected void drawCubic(Canvas c, LineDataSet dataSet, List entries) { protected void drawCubicFill(LineDataSet dataSet, Path spline, Transformer trans, int from, int to) { + if (to - from <= 1) + return; + float fillMin = dataSet.getFillFormatter() .getFillLinePosition(dataSet, mChart);