Issue in capturing Screenshot using Coregraphics



I’m trying to capture the screenshot of the view on iOS based on user selection of the area of the graph and not the entire grapgh itself.Once i have got the bezier path and the rect area. Here is what i’m doing. But when i do this the grapgh with axis and overlay remina but the series disappers in the screenshot.

I’m finding this a little strange. Can someone help me out?

CALayer *layer;
layer = self.view.layer;
CGContextClipToRect (UIGraphicsGetCurrentContext(),captureFrame);
[layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenImage = UIGraphicsGetImageFromCurrentImageContext();