Iphone Coreplot

こ雲淡風輕ζ 提交于 2019-12-02 05:04:50

问题


I am new to the iPhone development can anybody help me to draw curve chart in iPhone using only three values

-(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 curve chart using above code but i have many values in each array.. but i want plot using only three values in each array.


回答1:


Replace the following code:

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

with the following one:

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

Hope this helps!



来源:https://stackoverflow.com/questions/6053543/iphone-coreplot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!