GBLineChartData.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // GBLineChartData.h
  3. // GBChartDemo
  4. //
  5. // Created by midas on 2018/12/21.
  6. // Copyright © 2018 Midas. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. typedef NS_ENUM(NSUInteger, GBLineChartPointStyle) {
  11. GBLineChartPointStyleNone = 0,
  12. GBLineChartPointStyleCircle = 1, //圆形
  13. GBLineChartPointStyleSquare = 2, //方形
  14. GBLineChartPointStyleTriangle = 3, //三角形
  15. };
  16. @interface GBLineChartDataItem : NSObject
  17. @property (nonatomic, assign) CGFloat y;
  18. @property (nonatomic, assign) CGFloat x;
  19. + (id)dataItemWithY:(CGFloat)Y X:(CGFloat)X;
  20. @end
  21. typedef GBLineChartDataItem * (^GBLineChartDataGetter)(NSInteger item);
  22. @interface GBLineChartData : NSObject
  23. @property (nonatomic, copy) GBLineChartDataGetter dataGetter;
  24. @property (nonatomic, strong) UIColor *lineColor;
  25. @property (nonatomic, assign) CGFloat lineAlpha;
  26. @property (nonatomic, assign) NSInteger startIndex;
  27. @property (nonatomic, assign) NSInteger itemCount;
  28. @property (nonatomic, assign) CGFloat lineWidth;
  29. @property (nonatomic, assign) BOOL showPointLabel;
  30. @property (nonatomic, strong) UIColor *pointLabelColor;
  31. @property (nonatomic, strong) UIFont *pointLabelFont;
  32. @property (nonatomic, strong) NSString *pointLabelFormat;
  33. @property (nonatomic, assign) BOOL showDash;
  34. @property (nonatomic, strong) NSArray <NSNumber *> *lineDashPattern;
  35. @property (nonatomic, assign) GBLineChartPointStyle lineChartPointStyle;
  36. @property (nonatomic, assign) CGFloat inflexionPointWidth;
  37. @property (nonatomic, strong) UIColor *inflexionPointFillColor;
  38. @property (nonatomic, strong) UIColor *inflexionPointStrokeColor;
  39. //渐变区域
  40. /** 是否显示折线围成的渐变区域, 默认为0*/
  41. @property (nonatomic, assign) BOOL showGradientArea;
  42. /** 渐变开始的颜色 */
  43. @property (nonatomic, strong) UIColor *startGradientColor;
  44. /** 渐变结束的颜色 */
  45. @property (nonatomic, strong) UIColor *endGradientColor;
  46. @end