     private func drawLines() {
         
         let xOffset = calculateXoffset()
-        let yOffset = calculateYoffset().offset
+        let yData = calculateYoffset()
+        let yOffset = yData.offset
+        let maxValue = yData.maxValue
+        let minValue = yData.minValue
         
         for var lineIndex = 0; lineIndex < valuesArray.count; lineIndex++ {
             

        
        maxValue += abs(minValue)
        
        return (frame.height / maxValue, maxValue)
    }
    
    /**

            let lineValues = valuesArray[lineIndex]
            
            for var i = 0; i < lineValues.count; ++i {
                let value = (maxValue - lineValues[i] - abs(minValue)) * yOffset
                let point = CGPoint(x: leftLabelsWidth + CGFloat(i) * xOffset, y: value)
                
                if path.empty {
                    path.moveToPoint(point)
