             
             let label = UILabel(frame: CGRect(x: padding, y: y, width: 0, height: 0))
             label.font = labelFont
-            label.text = yLabelsFormatter(i, yLabels[i])
+            label.text = yLabelsFormatter(i, labels[i])
             label.textColor = labelColor
             label.sizeToFit()
             

        }
        
        drawAxes()
        if xLabels != nil || series.count > 0 {
            drawLabelsAndGridOnXAxis()
        }

        CGContextSetLineWidth(context, 0.5)
        
        var labels: Array<Float>
        if yLabels == nil {
            labels = [(min.y + max.y) / 2, max.y]
            if (yLabelsOnRightSide || min.y != 0) {
                labels.insert(min.y, atIndex: 0)
            }
        }
        else {
            labels = xLabels
        }
        
        let scaled = scaleValuesOnYAxis(labels)
        let padding: CGFloat = 5
        for (i, value) in enumerate(scaled) {
            
