1
このような円グラフにラベルを追加しました - (CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index {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)スライスのタイトルとその値を表示したい。 (3)タイトルとスライスに線を引く必要があります。 いずれかお手伝いください。事前に
おかげ