我刚刚将core-plot
从1.2升级到1.6。 y轴上的标签在iOS 8
中拧紧。当为目标7.1运行相同的项目时工作正常。
有同样问题的人吗?
y.majorIntervalLength是150和
plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.f) length:CPTDecimalFromFloat(2000.f)];
[![在此处输入图像说明] [1]] [1] [![此处输入图像说明] [2]] [2]
图。 iOS 8.2。图.iOS 7.1
// Axes config code
CPTXYAxisSet *axisSet = (CPTXYAxisSet *)_graph.axisSet;
CPTXYAxis *x = axisSet.xAxis;
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0];
dateFormatter.dateStyle = kCFDateFormatterShortStyle;
CPTTimeFormatter *timeFormatter = [[CPTTimeFormatter alloc] initWithDateFormatter:dateFormatter];
timeFormatter.referenceDate = _startDate;
x.labelFormatter = timeFormatter;
x.labelTextStyle = textStyle;
x.majorIntervalLength = CPTDecimalFromFloat(DT_ONE_DAY*3);
x.minorTicksPerInterval = 2;
CPTXYAxis *y = axisSet.yAxis;
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
numberFormatter.maximumSignificantDigits = 0;
y.labelFormatter = numberFormatter;
y.labelTextStyle = textStyle;
y.majorIntervalLength = CPTDecimalFromString(@"150");
y.minorTicksPerInterval = 1;