klauslanza

Added format block in previous method.

@@ -821,20 +821,26 @@ @@ -821,20 +821,26 @@
821 } 821 }
822 } 822 }
823 823
824 -  
825 - (NSString*) formatYLabel:(double)value{ 824 - (NSString*) formatYLabel:(double)value{
826 - if (!self.thousandsSeparator) { 825 +
827 - NSString *format = self.yLabelFormat ? : @"%1.f"; 826 + if (self.yLabelBlockFormatter)
828 - return [NSString stringWithFormat:format,value]; 827 + {
  828 + return self.yLabelBlockFormatter(value);
  829 + }
  830 + else
  831 + {
  832 + if (!self.thousandsSeparator) {
  833 + NSString *format = self.yLabelFormat ? : @"%1.f";
  834 + return [NSString stringWithFormat:format,value];
  835 + }
  836 +
  837 + NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init];
  838 + [numberFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4];
  839 + [numberFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
  840 + return [numberFormatter stringFromNumber: [NSNumber numberWithDouble:value]];
829 } 841 }
830 -  
831 - NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init];  
832 - [numberFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4];  
833 - [numberFormatter setNumberStyle: NSNumberFormatterDecimalStyle];  
834 - return [numberFormatter stringFromNumber: [NSNumber numberWithDouble:value]];  
835 } 842 }
836 843
837 -  
838 - (UIView*) getLegendWithMaxWidth:(CGFloat)mWidth{ 844 - (UIView*) getLegendWithMaxWidth:(CGFloat)mWidth{
839 if ([self.chartData count] < 1) { 845 if ([self.chartData count] < 1) {
840 return nil; 846 return nil;