     
     override func layoutSubviews() {
         super.layoutSubviews()
-        self.pathLayer.frame = self.bounds
         self.redraw()
     }
     
     func redraw() {
-        self.appendNewPathToPathLayer()
+        self.setNeedsDisplay()
     }
     
-    private func appendNewPathToPathLayer() {
-        self.pathLayer.path = self.newPathPart()
+    override func drawRect(rect: CGRect) {
+        guard let context = UIGraphicsGetCurrentContext() else {
+            return
+        }
+        
+        CGContextSetLineWidth(context, 1)///UIScreen.mainScreen().scale)
+        CGContextAddPath(context, self.newPathPart())
+        CGContextSetStrokeColorWithColor(context, self.lineColor.CGColor)
+        CGContextSetInterpolationQuality(context, .None);
+        CGContextSetAllowsAntialiasing(context, false);
+        CGContextSetShouldAntialias(context, false);
+        CGContextStrokePath(context)
     }
     
     private func newPathPart() -> CGPathRef {

                x: point.x * wProportion,
                y: point.y * hPropostion / 2.0)
            
            CGPathAddLineToPoint(mPath, nil, adjustedPoint.x,               self.bounds.midY - lineWidth/2)
            CGPathAddLineToPoint(mPath, nil, adjustedPoint.x,               self.bounds.midY - adjustedPoint.y - lineWidth/2)
            CGPathAddLineToPoint(mPath, nil, adjustedPoint.x + lineWidth,   self.bounds.midY - adjustedPoint.y - lineWidth/2)
            CGPathAddLineToPoint(mPath, nil, adjustedPoint.x + lineWidth,   self.bounds.midY - lineWidth/2)
        }
        CGPathAddLineToPoint(mPath, nil, CGPathGetCurrentPoint(mPath).x, self.bounds.midY)
        for index in 0..<currentCount {
            let index = currentCount - index - 1
            let point         = dataSource.pointAtIndex(index)
            let adjustedPoint = CGPoint(
                x: point.x * wProportion,
                y: point.y * hPropostion / 2.0)
            
            CGPathAddLineToPoint(mPath, nil, adjustedPoint.x,               self.bounds.midY + lineWidth/2)
            CGPathAddLineToPoint(mPath, nil, adjustedPoint.x,               self.bounds.midY + adjustedPoint.y + lineWidth/2)
            CGPathAddLineToPoint(mPath, nil, adjustedPoint.x + lineWidth,   self.bounds.midY + adjustedPoint.y + lineWidth/2)
            CGPathAddLineToPoint(mPath, nil, adjustedPoint.x + lineWidth,   self.bounds.midY + lineWidth/2)
        }
        
        CGPathAddLineToPoint(mPath, nil, 0.0, self.bounds.midY)

        return mPath
    }
}


