IntAxisValueFormatter.m 510 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // IntAxisValueFormatter.m
  3. // ChartsDemo
  4. // Copyright © 2016 dcg. All rights reserved.
  5. //
  6. #import "IntAxisValueFormatter.h"
  7. @implementation IntAxisValueFormatter
  8. {
  9. }
  10. -(void)setTitle:(NSMutableArray*)titleArray
  11. {
  12. _axisTitleArray=titleArray;
  13. }
  14. - (NSString *)stringForValue:(double)value
  15. axis:(ChartAxisBase *)axis
  16. {
  17. if(value>-1&&value<_axisTitleArray.count)
  18. {
  19. return [_axisTitleArray objectAtIndex:value];
  20. }
  21. else{
  22. return @"";
  23. }
  24. }
  25. @end