     /// :returns: true if the image was saved successfully
     public func saveToPath(path: String, format: ImageFormat, compressionQuality: Float) -> Bool
     {
-        var image = getChartImage();
+        var image = getChartImage(transparent: format != .JPEG);
 
         var imageData: NSData!;
         switch (format)

    }
    
    /// Returns the bitmap that represents the chart.
    public func getChartImage() -> UIImage
    {
        UIGraphicsBeginImageContextWithOptions(bounds.size, opaque, UIScreen.mainScreen().scale);
        
        layer.renderInContext(UIGraphicsGetCurrentContext());
        

    /// Saves the current state of the chart to the camera roll
    public func saveToCameraRoll()
    {
        UIImageWriteToSavedPhotosAlbum(getChartImage(transparent: false), nil, nil, nil);
    }
    
    internal typealias VoidClosureType = () -> ()
