0
我正在使用Coreplot,我需要幫助繪製圖表上的數據。使用Coreplot繪圖數據
我已經使用字典數據填充了一個名爲結果的數組。它輸出的內容如下(我已經縮短爲簡單起見數據) -
{
temperature = "5.0832667,5.2916833,4.6418246";
windspeed = "2.333,2.521,2.021,1.833,1.292,1.167";
}
我無法得到這個數據使用方法numberForPlot繪製。這是我迄今爲止所做的。下面是一個嘗試只繪製「溫度」的數據 -
-(NSNumber *)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index;
return [results valueForKey:@"temperature"];
{
我猜這是我創作我的字典的方式做,因爲他們是字符串,並且需要NSNumbers?作爲附加的註釋,這裏是創建該字典的代碼 -
for(counter = 0; counter < [node childCount]; counter++) {
[item setObject:[[node childAtIndex:counter] stringValue] forKey:[[node childAtIndex:counter] name]];
}
[results addObject:item];
任何幫助,因爲我一直試圖讓這個工作了好幾天,現在將不勝感激!謝謝