核心情节:如何在左侧,右侧,顶部和底部添加四个轴

时间:2014-03-03 10:35:21

标签: ios core-plot

默认左边和底部只有两个轴,我想在右边和底部添加另一个牵引轴,以显示相同的刻度和标签。

提前致谢。

1 个答案:

答案 0 :(得分:2)

在制作轴时可以使用约束

CPTXYAxis *x = [self _makeDefaultAxis];
x.coordinate = CPTCoordinateX;
x.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0];
x.tickDirection = CPTSignPositive;
// ...

CPTXYAxis *y = [self _makeDefaultAxis];
y.coordinate = CPTCoordinateY;
y.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0];
y.tickDirection = CPTSignPositive;
// ...

CPTXYAxis *y2 = [self _makeDefaultAxis];
y2.coordinate = CPTCoordinateY;
y2.axisConstraints = [CPTConstraints constraintWithUpperOffset:0.0];
y2.tickDirection = CPTSignNegative;
// ...

CPTXYAxis *x2 = [self _makeDefaultAxis];
x2.coordinate = CPTCoordinateX;
x2.axisConstraints = [CPTConstraints constraintWithUpperOffset:0.0];
x2.tickDirection = CPTSignNegative;

这给出了类似的东西,

Box axis

因此,还要显示调整填充等所需的标签。