             }
         }
         else {
-            labels = xLabels
+            labels = yLabels!
         }
         
         let scaled = scaleValuesOnYAxis(labels)

            label.frame.origin.y -= (label.frame.height - bottomInset) / 2
            
            // Set label's text alignment
            label.frame.size.width = (drawingWidth / CGFloat(xLabels.count)) - padding * 2
            label.textAlignment = xLabelsTextAlignment
            
            

                return point.x } )
        }
        else {
            labels = xLabels!
        }
        
        let scaled = scaleValuesOnXAxis(labels)
