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 400so 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.
精彩评论