I had added labels to the pie chart like this -(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index {
CPTTextLayer *newLayer = nil;
UIFont *theFont;
static CPTMutableTextStyle *whiteText = nil;
if ( !whiteText )
{
whiteText = [[CPTMutableTextStyle alloc] init];
whiteText.color = [CPTColor blackColor];
whiteText.textAlignment = CPTTextAlignmentCenter;
whiteText.fontName = @"Helvetica-Bold";
whiteText.fontSize = 10.0f;
theFont = [UIFont fontWithName:whiteText.fontName size:whiteText.fontSize];
}
if ( [plot isKindOfClass:[CPTPieChart class]] )
{
newLayer.delegate = self;
newLayer = [[[CPTTextLayer alloc] initWithText:[NSString stringWithFormat:@"%@", [pieChartData2 objectAtIndex:index]] style:whiteText] autorelease];
}
return newLayer;
}
What I want here is (1)I want to wrap the text which is too long. (2) I want to display the the Slice title and and its value . (3) I need to draw a line to title and Slice . Please any one help me.
预先感谢