开发者

display same color of text label as pie chart slice have

i am using core plot to draw pie chart and following text

Error 10

Pass 400

so for above data my pie chart conta开发者_如何学Pythonins 2 slice with 2 different color

i want to set the same text color for each slice

right now text is in white color

thank you


@pooja i got it :) try this without implementing

-sliceFillForPieChart:recordIndex:
-(CPLayer *)dataLabelForPlot:(CPPlot *)plot recordIndex:(NSUInteger)index 
{

CPTextLayer *label = [[CPTextLayer alloc] initWithText:[NSString stringWithFormat:@"%i", index]];
CPMutableTextStyle *textStyle = [label.textStyle mutableCopy];
textStyle.color = [CPPieChart defaultPieSliceColorForIndex:index];
label.textStyle = textStyle;
[textStyle release];
return [label autorelease];
}


You can use the labelTextStyle property of the plot to change the appearance of the labels.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜