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.
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