Saving Graph To Photo Album


Hello All,

I have an application that creates a graph with live data. Once it is done being made(it takes 60 seconds), I would like the user to be able to select to save the graph to their photos. Right now I am using the following block of code.

[chart.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);

This does take a picture of the graph. The only problem is that the line series are not drawn to the graph. The picture is just an empty graph. I've posted a link to some screenshots. One is how it takes the picture now. The other shows the graph with the line series that I would like to have drawn.

If anyone has any ideas of suggestions I would really appreciate it.,oN6WlOq


I apologize for the duplicate posts. The internet is rather iffy around here. 


Hi Willer,

Take a look at this blog post, I think it will help you: