Objective c 核心图:实时图-输入静态yAxis

Objective c 核心图:实时图-输入静态yAxis,objective-c,ios5,static,core-plot,Objective C,Ios5,Static,Core Plot,我的问题是,我不能在我的RealTimePlot示例中放置静态yAxis(没有移动)。 在运动过程中,X轴是静止的,但Y轴消失 我的代码是: -(void)renderInLayer:(CPTGraphHostingView *)layerHostingView withTheme:(CPTTheme *)theme { graph = [[[CPTXYGraph alloc] initWithFrame:bounds] autorelease]; layerHostingVi

我的问题是,我不能在我的RealTimePlot示例中放置静态yAxis(没有移动)。 在运动过程中,X轴是静止的,但Y轴消失

我的代码是:

-(void)renderInLayer:(CPTGraphHostingView *)layerHostingView withTheme:(CPTTheme *)theme
{

    graph = [[[CPTXYGraph alloc] initWithFrame:bounds] autorelease];
    layerHostingView.hostedGraph = graph;

    graph.plotAreaFrame.paddingTop    = 15.0;
    graph.plotAreaFrame.paddingRight  = 15.0;
    graph.plotAreaFrame.paddingBottom = 55.0;
    graph.plotAreaFrame.paddingLeft   = 55.0;

    // Axes
    // X axis
    CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet;
    CPTXYAxis *x          = axisSet.xAxis;
    x.labelingPolicy              = CPTAxisLabelingPolicyAutomatic;
    x.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(0);
    x.minorTicksPerInterval       = 9;
    x.title                       = @"X Axis";
    x.titleOffset                 = 35.0;

    // Y axis
    CPTXYAxis *y = axisSet.yAxis;
    y.labelingPolicy              = CPTAxisLabelingPolicyAutomatic;
    y.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(0);
    y.minorTicksPerInterval       = 3;
    y.labelOffset                 = 5.0;
    y.title                       = @"Y Axis";
    y.titleOffset                 = 30.0;

    y.constraints = CPTMakeConstraints(CPTConstraintNone, CPTConstraintFixed);

    // Rotate the labels by 45 degrees, just to show it can be done.
    x.labelRotation = M_PI * 0.25;

    // Create the plot
    CPTScatterPlot *dataSourceLinePlot = [[[CPTScatterPlot alloc] init] autorelease];
    dataSourceLinePlot.identifier     = kPlotIdentifier;
    dataSourceLinePlot.cachePrecision = CPTPlotCachePrecisionDouble;

    CPTMutableLineStyle *lineStyle = [[dataSourceLinePlot.dataLineStyle mutableCopy] autorelease];
    lineStyle.lineWidth              = 3.0;
    lineStyle.lineColor              = [CPTColor greenColor];
    dataSourceLinePlot.dataLineStyle = lineStyle;

    dataSourceLinePlot.dataSource = self;
    [graph addPlot:dataSourceLinePlot];
}

我的CorePlot版本是1.0


有什么想法吗?

在1.0发布之前,
约束的语法发生了变化。试一试

y.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0];

在Core Plot 1.0中不可能使用这一行,已弃用!!不,不是。在添加
CPTConstraints
类的同时,删除了
CPTMakeConstraints
函数。此更改是在0.9版本之前进行的,因此您不能使用1.0版本包。请参阅核心绘图更改日志()和此处的更改详细信息:好的,此代码没有错误:y.constraints=cptmakeconstaints(CPTConstraintNone,CPTConstraintFixed);或y.constraints=CPTMakeConstraints(cptConstraintOne,cptConstraintOne);但是结果没有发现。。。。移动推进时会显示yAxi。请确保应用程序引用了正确的核心绘图库和标题。
CPTMakeConstraints()
函数在1.0中不存在,应该会导致编译器错误。