1
我又增加了標籤餅圖這樣 - (CPTLayer *)dataLabelForPlot:(CPTPlot *)情節recordIndex:(NSUInteger)指數 {我如何包裝文字添加到情節在iPhone SDK中使用的核心情節庫
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;
}
我想這裏是 (1)我想換行是太長的文字。 (2)我想顯示Slice標題和它的值。 (3)我需要畫一條線來標題和切片。 請任何人幫助我。
在此先感謝