2013-07-28 81 views
0

我有一個餅圖工作使用數據源和委託方法的核心圖,但我現在試圖使用綁定和運行到一些問題。可可綁定和核心圖

我使用下面的代碼綁定到arraycontroller:

[graph addPlot:pieChart]; 

    // add bindings 
    NSLog(@"The arranged objects are: %@", [[[self sectorAllocation] arrangedObjects] valueForKey:@"sectorPercentage"]); 
    [pieChart bind:CPTPieChartBindingPieSliceWidthValues toObject:[self 
                sectorAllocation] withKeyPath:@"arrangedObjects.sectorPercentage" 
      options:nil]; 

    //Set the sorting 
    [[self sectorAllocation] setSortDescriptors:[NSArray arrayWithObject: 
             [NSSortDescriptor sortDescriptorWithKey:@"sectorPercentage" ascending:YES]]]; 

它似乎越來越掛了updateNormalizedData功能。根據我的NSlog聲明,我的arraycontroller正在返回適當的值,所以我不知道我在做什麼錯誤...任何建議?

enter image description here

回答

2

您發現餅圖中的錯誤。我只是修復它並將更改推送到存儲庫。使用Mercurial提取最新的代碼。如果您不想更新整個Core Plot庫,請使用更改here來修補您的副本。

+0

我之前使用的是二進制文件,所以不得不改變爲依賴方法...花了一點時間來設置,但一切都在工作,謝謝。 – Cory