DVXBarView.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. //
  2. // DVXBarView.h
  3. // xxxxx
  4. //
  5. // Created by Fire on 15/11/11.
  6. // Copyright © 2015年 DuoLaiDian. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @class DVXBarView;
  10. @protocol DVXBarViewDelegate <NSObject>
  11. @optional
  12. - (void)xBarView:(DVXBarView *)xBarView didClickButtonAtIndex:(NSInteger)index;
  13. @end
  14. @interface DVXBarView : UIView
  15. @property (weak, nonatomic) id<DVXBarViewDelegate> delegate;
  16. /**
  17. * 文字大小
  18. */
  19. @property (strong, nonatomic) UIFont *textFont;
  20. /**
  21. * 文字颜色
  22. */
  23. @property (strong, nonatomic) UIColor *textColor;
  24. /**
  25. * x轴文字与坐标轴间隙
  26. */
  27. @property (assign, nonatomic) CGFloat xAxisTextGap;
  28. /**
  29. * 坐标轴颜色
  30. */
  31. @property (strong, nonatomic) UIColor *axisColor;
  32. /**
  33. * y值的数组
  34. */
  35. @property (strong, nonatomic) NSArray *xValues;
  36. /**
  37. * y值的数组2
  38. */
  39. @property (strong, nonatomic) NSArray *xValues2;
  40. /**
  41. * y值的数组3
  42. */
  43. @property (strong, nonatomic) NSArray *xValues3;
  44. /**
  45. * y值的标题数组
  46. */
  47. @property (strong, nonatomic) NSArray *xTitles;
  48. /**
  49. * y值的标题数组2
  50. */
  51. @property (strong, nonatomic) NSArray *xTitles2;
  52. /**
  53. * y值的标题数组3
  54. */
  55. @property (strong, nonatomic) NSArray *xTitles3;
  56. /**
  57. * 柱与柱之间的间距
  58. */
  59. @property (assign, nonatomic) CGFloat barGap;
  60. /**
  61. * x轴的文字集合
  62. */
  63. @property (strong, nonatomic) NSArray *xAxisTitleArray;
  64. /**
  65. * y轴分为几段
  66. */
  67. @property (assign, nonatomic) int numberOfYAxisElements;
  68. /**
  69. * y轴的最大值
  70. */
  71. @property (assign, nonatomic) CGFloat yAxisMaxValue;
  72. /**
  73. * 是否显示点Label
  74. */
  75. @property (assign, nonatomic, getter=isShowPointLabel) BOOL showPointLabel;
  76. /**
  77. * 视图的背景颜色
  78. */
  79. @property (strong, nonatomic) UIColor *backColor;
  80. /**
  81. * 柱的宽度
  82. */
  83. @property (assign, nonatomic) CGFloat barWidth;
  84. /**
  85. * 柱的颜色
  86. */
  87. @property (strong, nonatomic) UIColor *barColor;
  88. /**
  89. * 柱的颜色
  90. */
  91. @property (strong, nonatomic) UIColor *barColor2;
  92. /**
  93. * 柱的颜色
  94. */
  95. @property (strong, nonatomic) UIColor *barColor3;
  96. /**
  97. * 柱的选中的颜色
  98. */
  99. @property (strong, nonatomic) UIColor *barSelectedColor;
  100. /**
  101. * pointLabel是否添加百分号
  102. */
  103. @property (assign, nonatomic, getter=isPercent) BOOL percent;
  104. /**
  105. * 点是否允许点击
  106. */
  107. @property (assign, nonatomic, getter=isBarUserInteractionEnabled) BOOL barUserInteractionEnabled;
  108. /**
  109. * 显示竖线
  110. */
  111. @property (assign, nonatomic, getter=isShowVerticalLine) BOOL showVerticalLine;
  112. /**
  113. * 标记选中哪一个柱子
  114. */
  115. @property (assign, nonatomic) NSInteger index;
  116. /**
  117. * 是否横屏
  118. */
  119. @property (assign,nonatomic,getter=isLandspace) BOOL landspace;
  120. /**
  121. * 是否是截图
  122. */
  123. @property (assign,nonatomic,getter=isShotImage) BOOL shotImage;
  124. - (void)draw;
  125. -(void)selectedIndex:(NSInteger)index;
  126. @end