Iphone Coreplot

时间:2011-05-19 03:50:21

标签: iphone charts draw

我是iPhone新手,任何人都可以帮我在iPhone中使用三个值绘制曲线图

-(NSUInteger)numberOfRecordsForPlot:(CPPlot *)plot
{
    NSLog(@"Array1-->%@",Array1);
    return [Array1 count];
}

-(NSNumber *)numberForPlot:(CPPlot *)plot
                     field:(NSUInteger)fieldEnum
               recordIndex:(NSUInteger)index
{
    NSLog(@"Array1-->%@",Array1);
    NSLog(@"marks1-->%@",marks1);

    if(fieldEnum == CPScatterPlotFieldX)
    { 
        return [Array1 objectAtIndex:index]; 
    }
    else
    {
        if(plot.identifier == @"X Squared Plot")
        {
            return [marks1 objectAtIndex:index]; 
        }
    }
}

iploted曲线图使用上面的代码,但我在每个数组中有很多值..但我想在每个数组中只使用三个值。

1 个答案:

答案 0 :(得分:0)

替换以下代码:

-(NSUInteger)numberOfRecordsForPlot:(CPPlot *)plot{
    NSLog(@"Array1-->%@",Array1);
    return [Array1 count];
    //return 50;
}

使用以下内容:

-(NSUInteger)numberOfRecordsForPlot:(CPPlot *)plot{
    NSLog(@"Array1-->%@",Array1);
    return 3;
}

希望这有帮助!

相关问题