开发者

display same color of text label as pie chart slice have

开发者 https://www.devze.com 2023-03-07 04:16 出处:网络
i am using core plot to draw pie chart and following text Error 10 Pass400 so for above data my pie chart conta开发者_如何学Pythonins 2 slice with 2 different color

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

精彩评论

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