【发布时间】:2014-05-24 12:53:22
【问题描述】:
我正在使用线图的核心图。在散点图中,我在散点图周围有一些空白区域。如您所见的屏幕截图(在调试模式下),我的图表区域被空白区域覆盖.我怎样才能删除它?
初始化主机视图
self.hostView = [(CPTGraphHostingView *) [CPTGraphHostingView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height-10)];
self.hostView.backgroundColor = [UIColor clearColor];;
self.hostView.allowPinchScaling = NO;
[self addSubview:self.hostView];
初始化图表
graph = [[CPTXYGraph alloc] initWithFrame:self.hostView.bounds];
[graph applyTheme:[CPTTheme themeNamed:kCPTPlainWhiteTheme]];
self.hostView.hostedGraph = graph;
编辑
graph.plotAreaFrame.PaddingLeft = 55.0f;
graph.plotAreaFrame.PaddingRight = 15.0f;
graph.plotAreaFrame.PaddingTop = 10.0f;
graph.plotAreaFrame.paddingBottom = 28.0;
这些是我提供的填充物。
【问题讨论】:
-
该图片的哪一部分是 Core Plot 托管视图(该图将填充托管视图)?检查视图的布局和图表各个部分的填充。
-
红线和红方块之间的部分是我得到的额外空间。我会更新有问题的填充。
-
托管视图/图表的边界在哪里?你在图表上也有填充吗?该图以每条边 20 像素的填充开始。
-
@EricSkroch 我没有在任何地方为图形设置任何填充。 stackoverflow.com/q/23846916/2265218点击这个链接你可以得到我的代码。
标签: ios objective-c core-plot scatter-plot