default there is only two axis on left and bottom, I want to add another tow axis on right and bottom to show the same tick and label.

Thanks in advance.

有帮助吗?

解决方案

You can do that with constraints when making your axis,

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;

Which gives something like,

Box axis

So also show the labels you need to adjust the padding etc.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top