我是核心图初学者。我想在我的应用程序中使用核心图,以显示我从遥远的数据库中获得的数据。我可以把我想要在数组中使用的数据,但我不知道如何使用这个数组来修改我的图形。将数据插入核心图
我有看核心情节谷歌网站(http://code.google.com/p/core-plot/)和堆栈溢出,但我找不到帮助我的东西。
这是图形显示的内容,我想用我的数组将图表插入图形图中。
编辑:
-(NSNumber *)numberForPlot:(CPPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index
{
NSDecimalNumber *num = nil;
if ([plot isKindOfClass:[CPBarPlot class]]) {
switch (fieldEnum) {
case CPBarPlotFieldBarLocation:
num = (NSDecimalNumber *)[NSDecimalNumber numberWithUnsignedInteger:index];
break;
case CPBarPlotFieldBarLength:
//num = (NSDecimalNumber *)[NSDecimalNumber numberWithUnsignedInteger:(index+10)+15];
//num = [NSNumber numberWithInt:values];
//num = (NSDecimalNumber *)[arrayTemperature objectAtIndex:index];
num =[ NSDecimalNumber numberWithInt:arrayTemperature ];
if ([plot.identifier isEqual:@"Bar Plot 2"])
num = [num decimalNumberBySubtracting:[NSDecimalNumber decimalNumberWithString:@"10"]];
break;
}
}
return num;
}
我也试过:
case CPBarPlotFieldBarLength:
//num = (NSDecimalNumber *)[NSDecimalNumber numberWithUnsignedInteger:(index+20)];
//num = [NSNumber numberWithInt:values];
//num = (NSDecimalNumber *)[arrayTemperature objectAtIndex:index]
num=nil;
int i=0;
for (i=0; i=9;i++){
num = [arrayTemperature objectAtIndex:i];
}
如果有人有关于如何使用阵列,或其他的想法来处理这个请让我知道一个想法。
我想你的解决方案,但它不工作我不知道为什么,我一直在为此工作3天,但没有找到解决方案。 我测试我的数组,它不是空的,它测试的类型,它的NSNumber。 我不知道该做什么更多 – ciwol 2010-12-07 10:44:21