如何旋转条形图的标签并在核心图中添加偏移量



只是想知道是否有一种方法来旋转放置在条形图上的标签并添加偏移量?谢谢你。

在我的委托实现下面。注意标签

的内边距
-(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index
{
    CPTMutableTextStyle *whiteTextStyle = [[[CPTMutableTextStyle alloc] init] autorelease];
    whiteTextStyle.color = [CPTColor whiteColor];
    whiteTextStyle.fontSize = 14.0f;
    CPTTextLayer *label = [[CPTTextLayer alloc] initWithText:@"Test" style:whiteTextStyle];
    label.paddingLeft = -100.0f; // <---
    return [label autorelease];
}

在plot上使用labelOffsetlabelRotation属性。

所有Core Plot都继承了CPTPlot

-dataLabelForPlot:recordIndex:中不应该设置padding

最新更新