Gianmaria Dal Maistro

show only titles, not values nor percentage

... ... @@ -32,6 +32,9 @@
/** Default is 1.0. */
@property (nonatomic) NSTimeInterval duration;
/** show only tiles, not values or percentage */
@property (nonatomic) BOOL hideValues;
/** Show only values, this is useful when legend is present */
@property (nonatomic) BOOL showOnlyValues;
... ...
... ... @@ -57,6 +57,11 @@
_descriptionTextShadowOffset = CGSizeMake(0, 1);
_duration = 1.0;
_shouldHighlightSectorOnTouch = YES;
<<<<<<< Updated upstream
=======
_enableMultipleSelection = NO;
_hideValues = NO;
>>>>>>> Stashed changes
[super setupDefaultValues];
[self loadDefault];
... ... @@ -130,6 +135,7 @@
UILabel *descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 80)];
NSString *titleText = currentDataItem.textDescription;
NSString *titleValue;
if (self.showAbsoluteValues) {
... ... @@ -137,9 +143,11 @@
}else{
titleValue = [NSString stringWithFormat:@"%.0f%%",[self ratioForItemAtIndex:index] * 100];
}
if(!titleText || self.showOnlyValues){
if (self.hideValues)
descriptionLabel.text = titleText;
else if(!titleText || self.showOnlyValues)
descriptionLabel.text = titleValue;
}
else {
NSString* str = [titleValue stringByAppendingString:[NSString stringWithFormat:@"\n%@",titleText]];
descriptionLabel.text = str ;
... ...