Fixed issue that caused candle-body not to be drawn.
diff --git a/MPChartLib/src/com/github/mikephil/charting/data/CandleEntry.java b/MPChartLib/src/com/github/mikephil/charting/data/CandleEntry.java
index e65be94..0074017 100644
--- a/MPChartLib/src/com/github/mikephil/charting/data/CandleEntry.java
+++ b/MPChartLib/src/com/github/mikephil/charting/data/CandleEntry.java
@@ -26,8 +26,8 @@
* @param xIndex The index on the x-axis.
* @param shadowH The (shadow) high value.
* @param shadowL The (shadow) low value.
- * @param open
- * @param close
+ * @param open The open value.
+ * @param close The close value.
*/
public CandleEntry(int xIndex, float shadowH, float shadowL, float open, float close) {
super((shadowH + shadowL) / 2f, xIndex);
diff --git a/MPChartLib/src/com/github/mikephil/charting/renderer/CandleStickChartRenderer.java b/MPChartLib/src/com/github/mikephil/charting/renderer/CandleStickChartRenderer.java
index fb5da74..bae707b 100644
--- a/MPChartLib/src/com/github/mikephil/charting/renderer/CandleStickChartRenderer.java
+++ b/MPChartLib/src/com/github/mikephil/charting/renderer/CandleStickChartRenderer.java
@@ -2,6 +2,7 @@
package com.github.mikephil.charting.renderer;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.Paint;
import com.github.mikephil.charting.animation.ChartAnimator;
@@ -137,7 +138,7 @@
// draw the body
c.drawRect(leftBody, close, rightBody, open, mRenderPaint);
- } else {
+ } else if(open < close) {
if (dataSet.getIncreasingColor() == ColorTemplate.COLOR_NONE) {
mRenderPaint.setColor(dataSet.getColor(j / 4 + minx));
@@ -148,6 +149,11 @@
mRenderPaint.setStyle(dataSet.getIncreasingPaintStyle());
// draw the body
c.drawRect(leftBody, open, rightBody, close, mRenderPaint);
+ } else { // equal values
+
+ mRenderPaint.setColor(Color.BLACK);
+ mRenderPaint.setStyle(Paint.Style.STROKE);
+ c.drawLine(leftBody, open, rightBody, close, mRenderPaint);
}
}
}