Gianmaria Dal Maistro

show only titles, not values nor percentage

@@ -32,6 +32,9 @@ @@ -32,6 +32,9 @@
32 /** Default is 1.0. */ 32 /** Default is 1.0. */
33 @property (nonatomic) NSTimeInterval duration; 33 @property (nonatomic) NSTimeInterval duration;
34 34
  35 +/** show only tiles, not values or percentage */
  36 +@property (nonatomic) BOOL hideValues;
  37 +
35 /** Show only values, this is useful when legend is present */ 38 /** Show only values, this is useful when legend is present */
36 @property (nonatomic) BOOL showOnlyValues; 39 @property (nonatomic) BOOL showOnlyValues;
37 40
@@ -57,6 +57,11 @@ @@ -57,6 +57,11 @@
57 _descriptionTextShadowOffset = CGSizeMake(0, 1); 57 _descriptionTextShadowOffset = CGSizeMake(0, 1);
58 _duration = 1.0; 58 _duration = 1.0;
59 _shouldHighlightSectorOnTouch = YES; 59 _shouldHighlightSectorOnTouch = YES;
  60 +<<<<<<< Updated upstream
  61 +=======
  62 + _enableMultipleSelection = NO;
  63 + _hideValues = NO;
  64 +>>>>>>> Stashed changes
60 65
61 [super setupDefaultValues]; 66 [super setupDefaultValues];
62 [self loadDefault]; 67 [self loadDefault];
@@ -130,6 +135,7 @@ @@ -130,6 +135,7 @@
130 135
131 UILabel *descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 80)]; 136 UILabel *descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 80)];
132 NSString *titleText = currentDataItem.textDescription; 137 NSString *titleText = currentDataItem.textDescription;
  138 +
133 NSString *titleValue; 139 NSString *titleValue;
134 140
135 if (self.showAbsoluteValues) { 141 if (self.showAbsoluteValues) {
@@ -137,9 +143,11 @@ @@ -137,9 +143,11 @@
137 }else{ 143 }else{
138 titleValue = [NSString stringWithFormat:@"%.0f%%",[self ratioForItemAtIndex:index] * 100]; 144 titleValue = [NSString stringWithFormat:@"%.0f%%",[self ratioForItemAtIndex:index] * 100];
139 } 145 }
140 - if(!titleText || self.showOnlyValues){ 146 +
  147 + if (self.hideValues)
  148 + descriptionLabel.text = titleText;
  149 + else if(!titleText || self.showOnlyValues)
141 descriptionLabel.text = titleValue; 150 descriptionLabel.text = titleValue;
142 - }  
143 else { 151 else {
144 NSString* str = [titleValue stringByAppendingString:[NSString stringWithFormat:@"\n%@",titleText]]; 152 NSString* str = [titleValue stringByAppendingString:[NSString stringWithFormat:@"\n%@",titleText]];
145 descriptionLabel.text = str ; 153 descriptionLabel.text = str ;