diff --git a/MPChartExample/src/com/xxmassdeveloper/mpchartexample/CombinedChartActivity.java b/MPChartExample/src/com/xxmassdeveloper/mpchartexample/CombinedChartActivity.java index 09d52fc84e..2ea81d1745 100644 --- a/MPChartExample/src/com/xxmassdeveloper/mpchartexample/CombinedChartActivity.java +++ b/MPChartExample/src/com/xxmassdeveloper/mpchartexample/CombinedChartActivity.java @@ -48,7 +48,7 @@ protected void onCreate(Bundle savedInstanceState) { // draw bars behind lines mChart.setDrawOrder(new DrawOrder[] { - DrawOrder.BAR, DrawOrder.LINE, DrawOrder.CANDLE + DrawOrder.BAR, DrawOrder.LINE }); YAxis rightAxis = mChart.getAxisRight(); diff --git a/MPChartLib/src/com/github/mikephil/charting/renderer/LineChartRenderer.java b/MPChartLib/src/com/github/mikephil/charting/renderer/LineChartRenderer.java index 5024b5c47b..dccd7a49cf 100644 --- a/MPChartLib/src/com/github/mikephil/charting/renderer/LineChartRenderer.java +++ b/MPChartLib/src/com/github/mikephil/charting/renderer/LineChartRenderer.java @@ -89,6 +89,8 @@ public void drawData(Canvas c) { } c.drawBitmap(mPathBitmap, 0, 0, mRenderPaint); + + drawCircles(c); } protected void drawDataSet(Canvas c, LineDataSet dataSet) { @@ -269,11 +271,11 @@ protected void drawLinear(Canvas c, LineDataSet dataSet, ArrayList entrie float phaseY = mAnimator.getPhaseY(); mRenderPaint.setStyle(Paint.Style.STROKE); - + Canvas canvas = null; - + // if the data-set is dashed, draw on bitmap-canvas - if(dataSet.isDashedLineEnabled()) { + if (dataSet.isDashedLineEnabled()) { canvas = mBitmapCanvas; } else { canvas = c; @@ -324,7 +326,8 @@ protected void drawLinear(Canvas c, LineDataSet dataSet, ArrayList entrie mRenderPaint.setColor(dataSet.getColor()); // c.drawLines(buffer.buffer, mRenderPaint); - canvas.drawLines(buffer.buffer, from, to >= buffer.size() ? buffer.size() - from : range, + canvas.drawLines(buffer.buffer, from, to >= buffer.size() ? buffer.size() - from + : range, mRenderPaint); } @@ -450,11 +453,11 @@ public void drawValues(Canvas c) { @Override public void drawExtras(Canvas c) { - drawCircles(c); + } protected void drawCircles(Canvas c) { - + mRenderPaint.setStyle(Paint.Style.FILL); float phaseX = mAnimator.getPhaseX(); @@ -468,7 +471,7 @@ protected void drawCircles(Canvas c) { if (!dataSet.isVisible() || !dataSet.isDrawCirclesEnabled()) continue; - + mCirclePaintInner.setColor(dataSet.getCircleHoleColor()); Transformer trans = mChart.getTransformer(dataSet.getAxisDependency()); @@ -483,7 +486,7 @@ protected void drawCircles(Canvas c) { float halfsize = dataSet.getCircleSize() / 2f; for (int j = 0; j < buffer.size(); j += 2) { - + float x = buffer.buffer[j]; float y = buffer.buffer[j + 1]; @@ -494,13 +497,16 @@ protected void drawCircles(Canvas c) { // bounds if (!mViewPortHandler.isInBoundsLeft(x) || !mViewPortHandler.isInBoundsY(y)) continue; - - mRenderPaint.setColor(dataSet.getCircleColor(j / 2)); + + int circleColor = dataSet.getCircleColor(j / 2); + + mRenderPaint.setColor(circleColor); c.drawCircle(x, y, dataSet.getCircleSize(), mRenderPaint); - if (dataSet.isDrawCircleHoleEnabled()) + if (dataSet.isDrawCircleHoleEnabled() + && circleColor != mCirclePaintInner.getColor()) c.drawCircle(x, y, halfsize, mCirclePaintInner);