【发布时间】:2011-10-21 13:30:44
【问题描述】:
我已经像这样在饼图中添加了标签 -(CPTLayer *)dataLabelForPlot:(CPTPlot *)绘图记录索引:(NSUInteger)索引 {
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) 我需要在 title 和 Slice 上画一条线。 请任何人帮助我。
提前致谢
【问题讨论】:
标签: objective-c ios4 core-plot