Karol Magier

Add prefix/suffix public property for y label values

@@ -46,6 +46,12 @@ typedef NSString *(^PNYLabelFormatter)(CGFloat yLabelValue); @@ -46,6 +46,12 @@ typedef NSString *(^PNYLabelFormatter)(CGFloat yLabelValue);
46 /** Formats the ylabel text. */ 46 /** Formats the ylabel text. */
47 @property (copy) PNYLabelFormatter yLabelFormatter; 47 @property (copy) PNYLabelFormatter yLabelFormatter;
48 48
  49 +/** Prefix to y label values, none if unset. */
  50 +@property (nonatomic) NSString *yLabelPrefix;
  51 +
  52 +/** Suffix to y label values, none if unset. */
  53 +@property (nonatomic) NSString *yLabelSuffix;
  54 +
49 @property (nonatomic) CGFloat chartMargin; 55 @property (nonatomic) CGFloat chartMargin;
50 56
51 /** Controls whether labels should be displayed. */ 57 /** Controls whether labels should be displayed. */
@@ -119,7 +119,7 @@ @@ -119,7 +119,7 @@
119 label.font = _labelFont; 119 label.font = _labelFont;
120 label.textColor = _labelTextColor; 120 label.textColor = _labelTextColor;
121 [label setTextAlignment:NSTextAlignmentRight]; 121 [label setTextAlignment:NSTextAlignmentRight];
122 - label.text = labelText; 122 + label.text = [NSString stringWithFormat:@"%@%@%@", _yLabelPrefix, labelText, _yLabelSuffix];
123 [self addSubview:label]; 123 [self addSubview:label];
124 124
125 [_yChartLabels addObject:label]; 125 [_yChartLabels addObject:label];