Bez popisu

AAChartView.h 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. //
  2. // AAChartView.h
  3. // AAChartKit
  4. //
  5. // Created by An An on 17/1/16.
  6. // Copyright © 2017年 An An. All rights reserved.
  7. //*************** ...... SOURCE CODE ...... ***************
  8. //***...................................................***
  9. //*** https://github.com/AAChartModel/AAChartKit ***
  10. //*** https://github.com/AAChartModel/AAChartKit-Swift ***
  11. //***...................................................***
  12. //*************** ...... SOURCE CODE ...... ***************
  13. /*
  14. * -------------------------------------------------------------------------------
  15. *
  16. * 🌕 🌖 🌗 🌘 ❀❀❀ WARM TIPS!!! ❀❀❀ 🌑 🌒 🌓 🌔
  17. *
  18. * Please contact me on GitHub,if there are any problems encountered in use.
  19. * GitHub Issues : https://github.com/AAChartModel/AAChartKit/issues
  20. * -------------------------------------------------------------------------------
  21. * And if you want to contribute for this project, please contact me as well
  22. * GitHub : https://github.com/AAChartModel
  23. * StackOverflow : https://stackoverflow.com/users/7842508/codeforu
  24. * JianShu : http://www.jianshu.com/u/f1e6753d4254
  25. * SegmentFault : https://segmentfault.com/u/huanghunbieguan
  26. *
  27. * -------------------------------------------------------------------------------
  28. */
  29. #import <UIKit/UIKit.h>
  30. #import "AAOptions.h"
  31. @protocol AAChartViewDidFinishLoadDelegate<NSObject>
  32. /**
  33. The delegate method of chart view finish loading
  34. */
  35. - (void)AAChartViewDidFinishLoad;
  36. @end
  37. @interface AAChartView:UIView
  38. @property (nonatomic, weak) id<AAChartViewDidFinishLoadDelegate> delegate;
  39. /**
  40. Set the chart view can scroll or not
  41. */
  42. @property (nonatomic, assign) BOOL scrollEnabled;
  43. /**
  44. Content width of AAChartView
  45. */
  46. @property (nonatomic, assign) CGFloat contentWidth;
  47. /**
  48. Content height of AAChartView
  49. */
  50. @property (nonatomic, assign) CGFloat contentHeight;
  51. /**
  52. Hide chart series content or not
  53. */
  54. @property (nonatomic, assign) BOOL chartSeriesHidden;
  55. /**
  56. Set the chart view background color be clear
  57. */
  58. @property (nonatomic, assign) BOOL isClearBackgroundColor;
  59. @property (nonatomic, assign) BOOL blurEffectEnabled;
  60. //***********************CONFIGURE THE CHART VIEW CONTENT WITH `AACHARTMODEL`***********************//
  61. /**
  62. Function of drawing chart view
  63. @param chartModel The instance object of chart model
  64. */
  65. - (void)aa_drawChartWithChartModel:(AAChartModel *)chartModel;
  66. /**
  67. Function of only refresh the chart data
  68. @param series Series array of AAChartModel instance object
  69. */
  70. - (void)aa_onlyRefreshTheChartDataWithChartModelSeries:(NSArray<NSDictionary *> *)series;
  71. /**
  72. Function of refreshing whole chart view content
  73. @param chartModel The instance object of chart model
  74. */
  75. - (void)aa_refreshChartWithChartModel:(AAChartModel *)chartModel;
  76. //***********************CONFIGURE THE CHART VIEW CONTENT WITH `AACHARTMODEL`***********************//
  77. //=======================CONFIGURE THE CHART VIEW CONTENT WITH `AAOPTIONS`=======================//
  78. /**
  79. Function of drawing chart view
  80. @param options The instance object of chart options
  81. */
  82. - (void)aa_drawChartWithOptions:(AAOptions *)options;
  83. /**
  84. Function of only refresh the chart data
  85. @param series Series array of AAOptions instance object
  86. */
  87. - (void)aa_onlyRefreshTheChartDataWithOptionsSeries:(NSArray<NSDictionary *> *)series;
  88. /**
  89. Function of refreshing whole chart view content
  90. @param options The instance object of chart options
  91. */
  92. - (void)aa_refreshChartWithOptions:(AAOptions *)options;
  93. //=======================CONFIGURE THE CHART VIEW CONTENT WITH `AAOPTIONS`=======================//
  94. /**
  95. Show the series element content with index
  96. @param elementIndex element index
  97. */
  98. - (void)aa_showTheSeriesElementContentWithSeriesElementIndex:(NSInteger)elementIndex;
  99. /**
  100. Hide the series element content with index
  101. @param elementIndex element index
  102. */
  103. - (void)aa_hideTheSeriesElementContentWithSeriesElementIndex:(NSInteger)elementIndex;
  104. @end
  105. @interface AAJsonConverter : NSObject
  106. /**
  107. Get pure options string
  108. @param optionsObject Instance object of AAOptions
  109. @return Pure options string without "\r" && "\n"
  110. */
  111. + (NSString *)getPureOptionsString:(id)optionsObject;
  112. /**
  113. Get pure series string
  114. @param series Series array of AAOptions
  115. @return Pure series string without "\r" && "\n"
  116. */
  117. + (NSString *)getPureSeriesString:(NSArray<NSDictionary*> *)series;
  118. @end