0
我有一個奇怪的問題,我的coreplot圖。 我有六個y軸,他們都有策略「CPTAxisLabelingPolicyEqualDivisions」。 圖形可以滾動,軸上的標籤已正確更新。 但有時,當我嘗試向下滾動圖表時,特定軸的最後一個標籤消失。核心繪圖1.2 - CPTAxisLabelingPolicyEqualDivisions,軸有時不顯示最後的標籤
這是爲創建所述軸線和相對地塊的代碼,plotspace:
CPTXYAxis *A_Axis = [[CPTXYAxis alloc] init] ;
A_Axis.coordinate = CPTCoordinateY;
A_Axis.orthogonalCoordinateDecimal = CPTDecimalFromCGFloat(_ASpace.yRange.locationDouble);
A_Axis.labelingPolicy = CPTAxisLabelingPolicyEqualDivisions;
A_Axis.majorGridLineStyle = majorGridLineStyle;
A_Axis.minorGridLineStyle = minorGridLineStyle;
A_Axis.preferredNumberOfMajorTicks = MAX_NUMBER_LABEL;
A_Axis.minorTicksPerInterval = 0;
A_Axis.labelOffset = 3.0;
A_Axis.labelPositionY = 0.0;
labelTextStyle.color = [CPTColor colorWithCGColor:A_Color.CGColor];
A_Axis.tickDirection = CPTSignNegative;
A_Axis.labelTextStyle = labelTextStyle;
A_Axis.axisConstraints = [CPTConstraints constraintWithRelativeOffset:0.0];
A_Axis.plotSpace = _ASpace;
CPTXYAxis *B_Axis = [[CPTXYAxis alloc] init] ;
B_Axis.coordinate = CPTCoordinateY;
B_Axis.orthogonalCoordinateDecimal = CPTDecimalFromCGFloat(_BSpace.yRange.locationDouble);
B_Axis.labelingPolicy = CPTAxisLabelingPolicyEqualDivisions;
B_Axis.majorGridLineStyle = majorGridLineStyle;
B_Axis.preferredNumberOfMajorTicks = MAX_NUMBER_LABEL;
B_Axis.minorTicksPerInterval = 0;
B_Axis.labelOffset = 3.0;
B_Axis.labelPositionY = 11.0;
labelTextStyle.color = [CPTColor colorWithCGColor:B_Color.CGColor];
B_Axis.tickDirection = CPTSignNegative;
B_Axis.labelTextStyle = labelTextStyle;
B_Axis.axisConstraints = [CPTConstraints constraintWithRelativeOffset:0.0];
B_Axis.plotSpace = _BSpace;
CPTXYAxis *C_Axis = [[CPTXYAxis alloc] init] ;
C_Axis.coordinate = CPTCoordinateY;
C_Axis.orthogonalCoordinateDecimal = CPTDecimalFromCGFloat(_CSpace.yRange.locationDouble);
C_Axis.labelingPolicy = CPTAxisLabelingPolicyEqualDivisions;
C_Axis.majorGridLineStyle = majorGridLineStyle;
C_Axis.preferredNumberOfMajorTicks = MAX_NUMBER_LABEL;
C_Axis.minorTicksPerInterval = 0;
C_Axis.labelOffset = 3.0;
C_Axis.labelPositionY = 22.0;
labelTextStyle.color = [CPTColor colorWithCGColor:C_Color.CGColor];
C_Axis.tickDirection = CPTSignNegative;
C_Axis.labelTextStyle = labelTextStyle;
C_Axis.axisConstraints = [CPTConstraints constraintWithRelativeOffset:0.0];
C_Axis.plotSpace = _CSpace;
CPTXYAxis *D_Axis = [[CPTXYAxis alloc] init] ;
D_Axis.coordinate = CPTCoordinateY;
D_Axis.orthogonalCoordinateDecimal = CPTDecimalFromCGFloat(_DSpace.yRange.locationDouble);
D_Axis.labelingPolicy = CPTAxisLabelingPolicyEqualDivisions;
D_Axis.majorGridLineStyle = majorGridLineStyle;
D_Axis.minorGridLineStyle = minorGridLineStyle;
D_Axis.preferredNumberOfMajorTicks = MAX_NUMBER_LABEL;
D_Axis.minorTicksPerInterval = 0;
D_Axis.labelOffset = 3.0;
D_Axis.labelPositionY = 0.0;
labelTextStyle.color = [CPTColor colorWithCGColor:D_Color.CGColor];
D_Axis.tickDirection = CPTSignPositive;
D_Axis.labelTextStyle = labelTextStyle;
D_Axis.axisConstraints = [CPTConstraints constraintWithRelativeOffset:1.0];
D_Axis.plotSpace = _DSpace;
CPTXYAxis *E_Axis = [[CPTXYAxis alloc] init] ;
E_Axis.coordinate = CPTCoordinateY;
E_Axis.orthogonalCoordinateDecimal = CPTDecimalFromCGFloat(_ESpace.yRange.locationDouble);
E_Axis.labelingPolicy = CPTAxisLabelingPolicyEqualDivisions;
E_Axis.majorGridLineStyle = majorGridLineStyle;
E_Axis.preferredNumberOfMajorTicks = MAX_NUMBER_LABEL;
E_Axis.minorTicksPerInterval = 0;
E_Axis.labelOffset = 3.0;
E_Axis.labelPositionY = 11.0;
labelTextStyle.color = [CPTColor colorWithCGColor:E_Color.CGColor];
E_Axis.tickDirection = CPTSignPositive;
E_Axis.labelTextStyle = labelTextStyle;
E_Axis.axisConstraints = [CPTConstraints constraintWithRelativeOffset:1.0];
E_Axis.plotSpace = _ESpace;
CPTXYAxis *F_Axis = [[CPTXYAxis alloc] init] ;
F_Axis.coordinate = CPTCoordinateY;
F_Axis.orthogonalCoordinateDecimal = CPTDecimalFromCGFloat(_FSpace.yRange.locationDouble);
F_Axis.labelingPolicy = CPTAxisLabelingPolicyEqualDivisions;
F_Axis.majorGridLineStyle = majorGridLineStyle;
F_Axis.preferredNumberOfMajorTicks = MAX_NUMBER_LABEL;
F_Axis.minorTicksPerInterval = 0;
F_Axis.labelOffset = 3.0;
F_Axis.labelPositionY = -11.0;
labelTextStyle.color = [CPTColor colorWithCGColor:F_Color.CGColor];
F_Axis.tickDirection = CPTSignPositive;
F_Axis.labelTextStyle = labelTextStyle;
F_Axis.axisConstraints = [CPTConstraints constraintWithRelativeOffset:1.0];
F_Axis.plotSpace = _FSpace;
我已經把3條第一軸線上的左側(與約束0),另一個在圖的右側。 問題的例子所示,其中最後一個綠色標籤是不可見的:提前
http://www.mathnormal.altervista.org/axis.png
感謝。
'labelPositionY'屬性做了什麼? –
我編輯了一些庫函數'setLabelOffset'。當標籤更新時,我向標籤點(x,y)添加一個y偏移量。但是問題不在這裏,因爲我從頭開始創建一個項目,使用最初的CorePlot Library(1.2版),問題是一樣的。您可以查看下面鏈接的視頻,以獲取更多解釋:[link](http://www.youtube.com/watch?v=ACzpSvRaOY8&feature=youtu.be)y範圍是[[CPTPlotRange plotRangeWithLocation:CPTDecimalFromCGFloat (10.0)長度:CPTDecimalFromCGFloat(50.0)]' – strstr