質問

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