2012-09-18 130 views
2

下面是圖的屏幕截圖... 在此圖中,y軸的最小值爲0(原點處),最大值爲700. 我想將最小值設置爲500,最大值爲700. here is the graph在覈心圖中配置座標軸

怎樣才能實現? 任何幫助,將不勝感激。

回答

3

嘗試使用這個,如果你正在使用的核心情節

CPXYPlotSpace *plotSpace = (CPXYPlotSpace *)graph.defaultPlotSpace; 
plotSpace.yRange = [CPPlotRange plotRangeWithLocation: 500 length:200 ]; 
3

有2個步驟來完成,

1. Setting the orthogonalCoordinateDecimal, this is the point where your graph starts 

    CPTXYAxis *y = axisSet.yAxis; 
    y.orthogonalCoordinateDecimal = CPTDecimalFromFloat(500.0); 

2. Setting the plotRange, this is to determine where should the graph start and its range 

    CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace; 
    plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:500 length:200]; 
+0

我試圖y軸的原點設置爲500,而是通過兩個刻度之間的方法距離變得更寬,通過orthogonalCoordinateDecimal我們可以改變y軸相交x軸的位置。 – RKY

+0

你的x.orthogonalCoordinateDecimal是什麼? – Charan

+0

你需要設置y.majorIntervalLength也 – Charan