我正在使用核心情节来绘制饼图和以下文字
错误10
通过400
因此,对于上述数据,我的饼图包含2个不同颜色的切片
我想为每个切片设置相同的文字颜色
现在文字为白色
谢谢
答案 0 :(得分:2)
@pooja我明白了:)试试这个而不实施
-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];
}
答案 1 :(得分:1)
您可以使用绘图的labelTextStyle
属性来更改标签的外观。