I want to draw a pie chart with some thickness. I have generated simple 2D pie chart. is there any way to make it 3D using some concepts of CALayer and then rotating in some direction.
-(void)CreatePieChart
{
graph = [[CPXYGraph alloc] initWithFrame: CGRectZero];
//CPGraphHostingView *hostingView = (CPGraphHostingView *)self.view;
viewGraphHostingPie.hostedGraph=graph;
CPPieChart *pieChart = [[CPPieChart alloc] init];
pieChart.dataSource = self;
pieChart.delegate = self;
pieChart.pieRadius = 100.0;
pieChart.identifier = @"PieChart1";
pieChart.startAngle=0;
pieChart.sliceDirection = CPPieDirectionCounterClockwise;
NSMutableArray *ValueArray = [[NSMutableArray alloc]init];
ValueArray = [NSArray arrayWithObjects:[NSNumber numberWithDouble:57.03],[NSNumber numberWithDouble:66.00],[NSNumber numberWithDouble:77.03],nil];
self.pieData = ValueArray;
CPTheme *theme = [CPTheme themeNamed:kCPDarkGradientTheme];
[graph applyTheme:theme];
[graph addPlot:pieChart];
[pieChart release];
}
It’s not clear to me what you mean by “concepts of CALayer”.
Have you considered using a free third party solution which will give you various charts, including pie charts, out of the box? Core Plot is free.
EDIT: Core Plot is 2D only, but you can produce a 3D effect by using shadows and/or overlay fill. See also the accepted answer here.