In my application I have a core-plot graph. The labels of the x-axis display in the graph area. This is a capture:

enter image description here

I don't know what is wrong. I'm using expandRangeByFactor for yRange with this code

[yRange expandRangeByFactor:CPTDecimalFromCGFloat(2.1f)];

But the problem is that when the data changes, the x-axis labels move up or down. I don't understand this behavior.

Is possible to fix the x-axis labels to one position, always at the bottom of graph.

Thank you in advance.

有帮助吗?

解决方案

It's hard to tell what's wrong without seeing your code, but you could try setting an axis constraint on the x axis:

CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet;
axisSet.xAxis.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top