Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Core plot 如何将Core Plot X标签移动到刻度之间?_Core Plot - Fatal编程技术网

Core plot 如何将Core Plot X标签移动到刻度之间?

Core plot 如何将Core Plot X标签移动到刻度之间?,core-plot,Core Plot,如何将X轴标签的文本向右(水平)移动? 我希望能够显示两个x记号(例如,|Jan | Feb |……)之间的字符串,而不是默认情况下跨在x记号上的字符串 我尝试了以下方法: newLabel = [[CPTAxisLabel alloc] initWithText:item.month textStyle:x.labelTextStyle]; newLabel.tickLocation = [[NSDecimalNumber numberWithInt:index] decimalValue];

如何将X轴标签的文本向右(水平)移动? 我希望能够显示两个x记号(例如,|Jan | Feb |……)之间的字符串,而不是默认情况下跨在x记号上的字符串

我尝试了以下方法:

newLabel = [[CPTAxisLabel alloc] initWithText:item.month textStyle:x.labelTextStyle];
newLabel.tickLocation = [[NSDecimalNumber numberWithInt:index] decimalValue];

CGPoint myPoint = newLabel.contentLayer.position;
CGFloat x = myPoint.x;
CGPoint yourPoint = myPoint;
yourPoint.x += 16.0;

[newLabel positionBetweenViewPoint:myPoint andViewPoint:yourPoint forCoordinate:CPTCoordinateX inDirection:CPTSignPositive];
…但我遇到了一个SIGABRT错误(崩溃)。
一个例子胜过千言万语

问候,,
Ric

现在没有一个简单的方法可以做到这一点。您需要使用自定义标签。将轴标记策略设置为
cptaxislabelingpolicyne
,并设置所需的标记位置和标签。有关一些示例代码,请参见Plot Gallery应用程序中的