LHYChartView.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. //
  2. // LHYChartView.h
  3. // LHYChartView
  4. //
  5. // Created by lreson on 16/7/21.
  6. // Copyright © 2016年 lreson. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "UIColor+expanded.h"
  10. #import "NSString+Extension.h"
  11. #define NS_ENUM(...) CF_ENUM(__VA_ARGS__)
  12. typedef NS_ENUM(NSInteger,LHYChartViewStyle){
  13. LHYChartViewMoreNoClickLine, //多条折现不可以点击 暂时没做
  14. LHYChartViewMoreClickLine, //多条折现可以点击
  15. LHYChartViewLeftRightLine, //左右两种不同数据
  16. };
  17. typedef NS_ENUM(NSInteger,LHYChartLayerStyle){
  18. LHYChartNone, //没有
  19. LHYChartGradient, //渐变
  20. LHYChartProjection, //投影
  21. };
  22. typedef NS_ENUM(NSInteger,LHYLineLayerStyle){
  23. LHYLineLayerNone, //没有
  24. LHYLineLayerGradient, //渐变
  25. };
  26. typedef NS_ENUM(NSInteger,LHYUnitStyle){
  27. LHYUnitGe, //个
  28. LHYUnitThousand, //千
  29. LHYUnitWan, //万
  30. LHYUnitMillion, /// 亿
  31. LHYUnitMoneyDefault,
  32. LHYUnitMoneyPercentage, /// 百分比,最大100%
  33. LHYUnitMoneyPercentageDefault, /// 百分比,有多大显示多大
  34. LHYUnitDefault /// 默认自适应
  35. };
  36. @interface LHYChartView : UIView
  37. /** X轴坐标数据 */
  38. @property (nonatomic, strong) NSArray *dataArrOfX;
  39. /** Y轴左边数据 */
  40. @property (nonatomic,strong) NSArray *leftDataArr;
  41. /** Y轴右边数据 没有不用传递 */
  42. @property (nonatomic,strong) NSArray *rightDataArr;
  43. /** X轴标题 */
  44. @property (nonatomic, strong) UILabel *titleOfX;
  45. /** Y轴标题 */
  46. @property (nonatomic, strong) UILabel *titleOfY;
  47. /// 线条宽度,默认为1
  48. @property (nonatomic, assign) CGFloat lineWidth;
  49. /// 计算精度,10,100,1000,默认是1
  50. @property (nonatomic,assign)NSInteger precisionScale;
  51. /// 折线图样式 默认不可点击
  52. @property (nonatomic,assign)LHYChartViewStyle chartViewStyle;
  53. /// 点否可以点击弹出泡泡
  54. @property (nonatomic,assign) BOOL isSelect;
  55. /// 气泡是否根据折线位置可以浮动,默认不可以
  56. @property (nonatomic,assign)BOOL isFloating;
  57. /// 图层样式 默认没有
  58. @property (nonatomic,assign) LHYChartLayerStyle chartLayerStyle;
  59. //左侧标注折线颜色组可传二进制字符串,可传UIColor
  60. @property (nonatomic, strong) NSArray *leftColorStrArr;
  61. //右侧标注折线颜色组
  62. @property (nonatomic, strong) NSArray *rightColorStrArr;
  63. //X轴坐标字体大小
  64. @property (nonatomic, strong) UIFont *x_Font;
  65. //X轴坐标选中字体大小
  66. @property (nonatomic, strong) UIFont *x_Select_Font;
  67. //X轴坐标选中字体颜色
  68. @property (nonatomic, strong) UIColor *x_Select_Color;
  69. //X轴坐标字体颜色
  70. @property (nonatomic, strong) UIColor *x_Color;
  71. //Y轴坐标字体大小
  72. @property (nonatomic, strong) UIFont *y_Font;
  73. //Y轴坐标字体颜色
  74. @property (nonatomic, strong) UIColor *y_Color;
  75. //X轴间隔大小
  76. @property (nonatomic, assign) CGFloat Xmargin;
  77. /// 折现样式 默认没有
  78. @property (nonatomic, assign) LHYLineLayerStyle lineLayerStyle;
  79. /// 折现渐变颜色组
  80. @property (nonatomic, strong) NSArray * colors;
  81. /// 渐变比例 0-1 初始化0.5
  82. @property (nonatomic, assign) CGFloat proportion;
  83. /// 显示多少行 默认2行
  84. @property (nonatomic,assign)NSInteger row;
  85. /// 是否显示所有点 默认不显示
  86. @property (nonatomic, assign)BOOL isShow;
  87. /// 设置泡泡的背景色
  88. @property (nonatomic, strong) UIColor *paopaoBackGroundColor;
  89. /// 设置标线颜色
  90. @property (nonatomic,strong) UIColor * markColor;
  91. /// 泡泡的标题颜色
  92. @property (nonatomic,strong) UIColor * paopaoTitleColor;
  93. /// 泡泡的数据颜色组
  94. @property (nonatomic,strong) NSArray * paopaoDataColors;
  95. /// 泡泡的显示数据组
  96. @property (nonatomic,strong) NSArray * paopaoDataArray;
  97. /// 小数点千位还是万位,没有单位。如不设置此参数,默认大于1000以k表示,如1500,显示为1.5k。
  98. @property (nonatomic,assign) LHYUnitStyle unitStyle;
  99. /// 泡泡标题组,如果不传,将默认不显示titile。
  100. @property (nonatomic, strong) NSArray *paopaoTitleArray;
  101. /// 是否显示网格
  102. @property (nonatomic,assign) BOOL isGrid;
  103. /// x坐标初始显示多少列
  104. @property (nonatomic,assign) NSInteger xRow;
  105. /// 边框标线颜色
  106. @property (nonatomic,strong) UIColor * borderLineColor;
  107. /// 中间标线颜色
  108. @property (nonatomic,strong) UIColor * middleLineColor;
  109. /// 边框三角颜色
  110. @property (nonatomic,strong) UIColor * borderTriangleColor;
  111. /// 渐变比例组
  112. @property (nonatomic,strong) NSArray * locations;
  113. /// 是否显示Y坐标轴 默认为YES显示
  114. @property (nonatomic,assign) BOOL isShowYtext;
  115. /// 是否显示第一个泡泡,默认为NO不显示。
  116. @property (nonatomic,assign) BOOL isShowFirstPaoPao;
  117. /// 是否显示最后一个泡泡,默认为NO不显示。
  118. @property (nonatomic,assign) BOOL isShowLastPaoPao;
  119. /// 选中状态的圆,外圆是否是白色
  120. @property (nonatomic,assign) BOOL isShowCircleOutWhite;
  121. /// 折线图是否从零点开始画 YES为从1点开始画 NO为从零点开始画 默认为NO
  122. @property (nonatomic,assign) BOOL hiddenZreo;
  123. /// 最大值
  124. @property (nonatomic,assign) CGFloat max;
  125. /// 最大值
  126. @property (nonatomic,assign) CGFloat min;
  127. /**
  128. Y轴单位
  129. */
  130. @property (nonatomic,strong) NSString * unitName;
  131. /// 显示
  132. -(void)show;
  133. /// 初始化
  134. -(void)initNew;
  135. @end