仅在核心图中滚动浏览数据 iOS

Scrolling through data only in core plot iOS

目前我正在使用core plot cocoa pod绘制散点图,目前我需要启用滚动但是同时我需要x & y 轴固定在屏幕的一角,并且只能通过任何方式移动数据才能做到这一点?
我当前对以下代码的实现让我滚动浏览数据,但是当我滚动浏览图表时 x 轴或 y 轴消失

-(void) viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
CPTGraphHostingView* hostView = [[CPTGraphHostingView alloc] initWithFrame:self.view.frame];
[self.view addSubview: hostView];

// Create a CPTGraph object and add to hostView
CPTGraph* graph = [[CPTXYGraph alloc] initWithFrame:hostView.bounds];
hostView.hostedGraph = graph;

// Get the (default) plotspace from the graph so we can set its x/y ranges
CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *) graph.defaultPlotSpace;

plotSpace.allowsUserInteraction=YES;

// Note that these CPTPlotRange are defined by START and LENGTH (not START and END) !!
[plotSpace setYRange:[CPTPlotRange plotRangeWithLocation:[NSNumber numberWithInt:0] length:[NSNumber numberWithInt:10]]];

[plotSpace setXRange:[CPTPlotRange plotRangeWithLocation:[NSNumber numberWithInt:0] length:[NSNumber numberWithInt:10]]];

plotSpace.delegate = self;

graph.paddingLeft   = 10.0;
graph.paddingRight  = 10.0;
graph.paddingTop    = 10.0;
graph.paddingBottom = 10.0;

// Create the plot (we do not define actual x/y values yet, these will be supplied by the datasource...)
CPTScatterPlot* plot = [[CPTScatterPlot alloc] initWithFrame:CGRectZero];

// Let's keep it simple and let this class act as datasource (therefore we implemtn <CPTPlotDataSource>)
plot.dataSource = self;

// Finally, add the created plot to the default plot space of the CPTGraph object we created before
[graph addPlot:plot toPlotSpace:graph.defaultPlotSpace];
}

提前致谢:)

使用 axisConstraints:

x.axisConstraints = [CPTConstraints constraintWithRelativeOffset:0.0];
y.axisConstraints = [CPTConstraints constraintWithRelativeOffset:0.0];

使用 0.0 将轴置于左侧(y 轴)或底部(x 轴)。使用 1.0 将轴放置在右侧(y 轴)或顶部(x 轴)。 0.0 和 1.0 之间的任何分数都是有效的。