Merge pull request #241 from NoICE/0.8.6-update-data
PieChart: add updateData() method
Showing
2 changed files
with
7 additions
and
0 deletions
| @@ -52,6 +52,9 @@ | @@ -52,6 +52,9 @@ | ||
| 52 | 52 | ||
| 53 | @property (nonatomic, weak) id<PNChartDelegate> delegate; | 53 | @property (nonatomic, weak) id<PNChartDelegate> delegate; |
| 54 | 54 | ||
| 55 | +/** Update chart items. Does not update chart itself. */ | ||
| 56 | +- (void)updateChartData:(NSArray *)data; | ||
| 57 | + | ||
| 55 | - (void)strokeChart; | 58 | - (void)strokeChart; |
| 56 | 59 | ||
| 57 | - (void)recompute; | 60 | - (void)recompute; |
| @@ -171,6 +171,10 @@ | @@ -171,6 +171,10 @@ | ||
| 171 | return descriptionLabel; | 171 | return descriptionLabel; |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | +- (void)updateChartData:(NSArray *)items { | ||
| 175 | + self.items = items; | ||
| 176 | +} | ||
| 177 | + | ||
| 174 | - (PNPieChartDataItem *)dataItemForIndex:(NSUInteger)index{ | 178 | - (PNPieChartDataItem *)dataItemForIndex:(NSUInteger)index{ |
| 175 | return self.items[index]; | 179 | return self.items[index]; |
| 176 | } | 180 | } |
-
Please register or login to post a comment