Core-Plot绘图边距问题

1


默认四边的内边距都为20.0f。


1. 内边距

1
2
3
4
5
6
7
8
9
10
11
// 基于xy轴的图表创建
CPTXYGraph *graph=[[CPTXYGraph alloc] initWithFrame:_hostView.bounds];

// 使宿主视图的hostedGraph与CPTGraph关联
_hostView.hostedGraph = graph;

// 设置内边距:默认 20.0f
graph.paddingLeft = CPTFloat(0);
graph.paddingTop = CPTFloat(200);
graph.paddingRight = CPTFloat(0);
graph.paddingBottom = CPTFloat(0);

CPTGraphHostingView 的背景色为蓝色,plotAreaFrame 绘图区域背景色为黄色

2

2. 绘图边距

1
2
3
4
graph.plotAreaFrame.paddingLeft   = CPTFloat(0);
graph.plotAreaFrame.paddingTop = CPTFloat(200);
graph.plotAreaFrame.paddingRight = CPTFloat(0);
graph.plotAreaFrame.paddingBottom = CPTFloat(0);

3

设置绘图边距只会改变绘图图形的大小

4

坚持原创技术分享,您的支持将鼓励我继续创作!