@@ -21,13 +21,20 @@ public class YAxisRenderer extends AxisRenderer {
2121
2222 protected YAxis mYAxis ;
2323
24+ protected Paint mZeroLinePaint ;
25+
2426 public YAxisRenderer (ViewPortHandler viewPortHandler , YAxis yAxis , Transformer trans ) {
2527 super (viewPortHandler , trans );
2628
2729 this .mYAxis = yAxis ;
2830
2931 mAxisLabelPaint .setColor (Color .BLACK );
3032 mAxisLabelPaint .setTextSize (Utils .convertDpToPixel (10f ));
33+
34+ mZeroLinePaint = new Paint (Paint .ANTI_ALIAS_FLAG );
35+ mZeroLinePaint .setColor (Color .GRAY );
36+ mZeroLinePaint .setStrokeWidth (1f );
37+ mZeroLinePaint .setStyle (Paint .Style .STROKE );
3138 }
3239
3340 /**
@@ -283,7 +290,7 @@ public void renderGridLines(Canvas c) {
283290 position [1 ] = 0f ;
284291 mTrans .pointValuesToPixel (position );
285292
286- drawZeroLine (c , mViewPortHandler .offsetLeft (), mViewPortHandler .contentRight (), position [1 ], position [1 ]);
293+ drawZeroLine (c , mViewPortHandler .offsetLeft (), mViewPortHandler .contentRight (), position [1 ]- 1 , position [1 ]- 1 );
287294 }
288295 }
289296
@@ -298,13 +305,16 @@ public void renderGridLines(Canvas c) {
298305 */
299306 protected void drawZeroLine (Canvas c , float x1 , float x2 , float y1 , float y2 ) {
300307
308+ mZeroLinePaint .setColor (mYAxis .getZeroLineColor ());
309+ mZeroLinePaint .setStrokeWidth (mYAxis .getZeroLineWidth ());
310+
301311 Path zeroLinePath = new Path ();
302312
303313 zeroLinePath .moveTo (x1 , y1 );
304314 zeroLinePath .lineTo (x2 , y2 );
305315
306316 // draw a path because lines don't support dashing on lower android versions
307- c .drawPath (zeroLinePath , mGridPaint );
317+ c .drawPath (zeroLinePath , mZeroLinePaint );
308318 }
309319
310320 /**
0 commit comments