这是图形的屏幕截图...在此图中,y 轴的最小值为 0(原点),最大值为 700。我想将最小值设置为 500,最大值设置为 700。
如何实现?任何帮助,将不胜感激。
如果您正在使用核心情节,请尝试使用它
CPXYPlotSpace *plotSpace = (CPXYPlotSpace *)graph.defaultPlotSpace;
plotSpace.yRange = [CPPlotRange plotRangeWithLocation: 500 length:200 ];
有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];