                 
                 // Set the color for the currently drawn value. If the index is out of bounds, reuse colors.
                 CGContextSetFillColorWithColor(context, dataSet.colorAt(j).CGColor)
-                CGContextFillRect(context, barRect)
+
+                if let (raundingCorners, cornerRadii) = self.calcRectCorners(y) {
+                    let path: UIBezierPath = UIBezierPath(roundedRect: barRect,
+                        byRoundingCorners: raundingCorners,
+                        cornerRadii: cornerRadii)
+                    path.fill()
+                }
+                else {
+                    CGContextFillRect(context, barRect)
+                }
             }
             else
             {

        
        return CGFloat(barData.yValCount) < CGFloat(delegate!.barChartRendererMaxVisibleValueCount(self)) * viewPortHandler.scaleX
    }
}
                    posOffset = -posOffset - valueTextHeight
                    negOffset = -negOffset - valueTextHeight
                }

                self.modifyValuesOffsets(&posOffset, negOffset: &negOffset)

                var valueTextColor = dataSet.valueTextColor
                
                var formatter = dataSet.valueFormatter
