2012-09-18 58 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