Saving Graph To Photo Album


#1

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.

UIGrpahicsBeginImageContext(chart.bounds.size);
[chart.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
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.

http://imgur.com/ohsTaUo,oN6WlOq


#2

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


#3

Hi Willer,

Take a look at this blog post, I think it will help you:
http://www.shinobicontrols.com/blog/posts/2012/03/26/taking-a-shinobichart-screenshot-from-your-app/

Jan