0
我已經使用corePlot_0.4庫創建了Piechart(CPTGraphHostingView)。 Piechart正確顯示在帶有labelforPiechart的UIView上, 同樣從該餅圖視圖中我創建了通過電子郵件發送的圖像。但是,雖然我從使用GraphicsContext的餅圖視圖獲取圖像,但只有圖像上顯示的餅圖標籤不可見。Piechart標籤在圖像上不可見
下面是我從餅圖視圖獲取圖像的代碼:
// Get the image from piechartview
-(UIImage *) GetImageFromView{
if (NULL != UIGraphicsBeginImageContextWithOptions)
UIGraphicsBeginImageContextWithOptions PieChartView.bounds.size, NO, 0);
else
UIGraphicsBeginImageContext(PieChartView.view.bounds.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
[rpsvc.view.layer renderInContext:context];
CGContextRestoreGState(context);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}