Nav apraksta

AAChartModel.h 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. //
  2. // AAChartModel.h
  3. // AAChartKit
  4. //
  5. // Created by An An on 17/1/20.
  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 <Foundation/Foundation.h>
  30. #import "AASeriesElement.h"
  31. #import "AAPlotLinesElement.h"
  32. #define AACHARTKIT_EXTERN extern __attribute__((visibility ("default")))
  33. typedef NS_ENUM(NSInteger,AAChartAnimation) {
  34. AAChartAnimationLinear = 0,
  35. AAChartAnimationEaseInQuad,
  36. AAChartAnimationEaseOutQuad,
  37. AAChartAnimationEaseInOutQuad,
  38. AAChartAnimationEaseInCubic,
  39. AAChartAnimationEaseOutCubic,
  40. AAChartAnimationEaseInOutCubic,
  41. AAChartAnimationEaseInQuart,
  42. AAChartAnimationEaseOutQuart,
  43. AAChartAnimationEaseInOutQuart,
  44. AAChartAnimationEaseInQuint,
  45. AAChartAnimationEaseOutQuint,
  46. AAChartAnimationEaseInOutQuint,
  47. AAChartAnimationEaseInSine,
  48. AAChartAnimationEaseOutSine,
  49. AAChartAnimationEaseInOutSine,
  50. AAChartAnimationEaseInExpo,
  51. AAChartAnimationEaseOutExpo,
  52. AAChartAnimationEaseInOutExpo,
  53. AAChartAnimationEaseInCirc,
  54. AAChartAnimationEaseOutCirc,
  55. AAChartAnimationEaseInOutCirc,
  56. AAChartAnimationEaseOutBounce,
  57. AAChartAnimationEaseInBack,
  58. AAChartAnimationEaseOutBack,
  59. AAChartAnimationEaseInOutBack,
  60. AAChartAnimationElastic,
  61. AAChartAnimationSwingFromTo,
  62. AAChartAnimationSwingFrom,
  63. AAChartAnimationSwingTo,
  64. AAChartAnimationBounce,
  65. AAChartAnimationBouncePast,
  66. AAChartAnimationEaseFromTo,
  67. AAChartAnimationEaseFrom,
  68. AAChartAnimationEaseTo,
  69. };
  70. typedef NSString *AAChartType;
  71. typedef NSString *AAChartSubtitleAlignType;
  72. typedef NSString *AAChartZoomType;
  73. typedef NSString *AAChartStackingType;
  74. typedef NSString *AAChartSymbolType;
  75. typedef NSString *AAChartSymbolStyleType;
  76. typedef NSString *AAChartFontWeightType;
  77. typedef NSString *AALineDashSyleType;
  78. AACHARTKIT_EXTERN AAChartType const AAChartTypeColumn;
  79. AACHARTKIT_EXTERN AAChartType const AAChartTypeBar;
  80. AACHARTKIT_EXTERN AAChartType const AAChartTypeArea;
  81. AACHARTKIT_EXTERN AAChartType const AAChartTypeAreaspline;
  82. AACHARTKIT_EXTERN AAChartType const AAChartTypeLine;
  83. AACHARTKIT_EXTERN AAChartType const AAChartTypeSpline;
  84. AACHARTKIT_EXTERN AAChartType const AAChartTypeScatter;
  85. AACHARTKIT_EXTERN AAChartType const AAChartTypePie;
  86. AACHARTKIT_EXTERN AAChartType const AAChartTypeBubble;
  87. AACHARTKIT_EXTERN AAChartType const AAChartTypePyramid;
  88. AACHARTKIT_EXTERN AAChartType const AAChartTypeFunnel;
  89. AACHARTKIT_EXTERN AAChartType const AAChartTypeColumnrange;
  90. AACHARTKIT_EXTERN AAChartType const AAChartTypeArearange;
  91. AACHARTKIT_EXTERN AAChartType const AAChartTypeAreasplinerange;
  92. AACHARTKIT_EXTERN AAChartType const AAChartTypeBoxplot;
  93. AACHARTKIT_EXTERN AAChartType const AAChartTypeWaterfall;
  94. AACHARTKIT_EXTERN AAChartType const AAChartTypePolygon;
  95. AACHARTKIT_EXTERN AAChartSubtitleAlignType const AAChartSubtitleAlignTypeLeft;
  96. AACHARTKIT_EXTERN AAChartSubtitleAlignType const AAChartSubtitleAlignTypeCenter;
  97. AACHARTKIT_EXTERN AAChartSubtitleAlignType const AAChartSubtitleAlignTypeRight;
  98. AACHARTKIT_EXTERN AAChartZoomType const AAChartZoomTypeNone;
  99. AACHARTKIT_EXTERN AAChartZoomType const AAChartZoomTypeX;
  100. AACHARTKIT_EXTERN AAChartZoomType const AAChartZoomTypeY;
  101. AACHARTKIT_EXTERN AAChartZoomType const AAChartZoomTypeXY;
  102. AACHARTKIT_EXTERN AAChartStackingType const AAChartStackingTypeFalse;
  103. AACHARTKIT_EXTERN AAChartStackingType const AAChartStackingTypeNormal;
  104. AACHARTKIT_EXTERN AAChartStackingType const AAChartStackingTypePercent;
  105. AACHARTKIT_EXTERN AAChartSymbolType const AAChartSymbolTypeCircle;
  106. AACHARTKIT_EXTERN AAChartSymbolType const AAChartSymbolTypeSquare;
  107. AACHARTKIT_EXTERN AAChartSymbolType const AAChartSymbolTypeDiamond;
  108. AACHARTKIT_EXTERN AAChartSymbolType const AAChartSymbolTypeTriangle;
  109. AACHARTKIT_EXTERN AAChartSymbolType const AAChartSymbolTypeTriangle_down;
  110. AACHARTKIT_EXTERN AAChartSymbolStyleType const AAChartSymbolStyleTypeDefault;
  111. AACHARTKIT_EXTERN AAChartSymbolStyleType const AAChartSymbolStyleTypeInnerBlank;
  112. AACHARTKIT_EXTERN AAChartSymbolStyleType const AAChartSymbolStyleTypeBorderBlank;
  113. AACHARTKIT_EXTERN AAChartFontWeightType const AAChartFontWeightTypeThin;
  114. AACHARTKIT_EXTERN AAChartFontWeightType const AAChartFontWeightTypeRegular;
  115. AACHARTKIT_EXTERN AAChartFontWeightType const AAChartFontWeightTypeBold;
  116. AACHARTKIT_EXTERN AALineDashSyleType const AALineDashSyleTypeSolid;
  117. AACHARTKIT_EXTERN AALineDashSyleType const AALineDashSyleTypeShortDash;
  118. AACHARTKIT_EXTERN AALineDashSyleType const AALineDashSyleTypeShortDot;
  119. AACHARTKIT_EXTERN AALineDashSyleType const AALineDashSyleTypeShortDashDot;
  120. AACHARTKIT_EXTERN AALineDashSyleType const AALineDashSyleTypeShortDashDotDot;
  121. AACHARTKIT_EXTERN AALineDashSyleType const AALineDashSyleTypeDot;
  122. AACHARTKIT_EXTERN AALineDashSyleType const AALineDashSyleTypeDash;
  123. AACHARTKIT_EXTERN AALineDashSyleType const AALineDashSyleTypeLongDash;
  124. AACHARTKIT_EXTERN AALineDashSyleType const AALineDashSyleTypeDashDot;
  125. AACHARTKIT_EXTERN AALineDashSyleType const AALineDashSyleTypeLongDashDot;
  126. AACHARTKIT_EXTERN AALineDashSyleType const AALineDashSyleTypeLongDashDotDot;
  127. @interface AAChartModel : NSObject
  128. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, title);//标题内容
  129. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, titleFontSize);//Title label font size
  130. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, titleFontColor);//Title label font color
  131. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, titleFontWeight);//Title label font weight
  132. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, subtitle);//副标题内容
  133. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, subtitleFontSize);//Subtitle label font size
  134. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, subtitleFontColor);//Subtitle label font color
  135. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, subtitleFontWeight);//Subtitle label font weight
  136. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, backgroundColor);//图表背景色(必须为十六进制的颜色色值如红色"#FF0000")
  137. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSArray <NSString *>*, colorsTheme);//图表主题颜色数组
  138. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSArray <NSString *>*, categories);//x轴坐标每个点对应的名称(注意:这个不是用来设置 X 轴的值,仅仅是用于设置 X 轴文字内容的而已)
  139. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSArray *, series);//图表的数据列内容
  140. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, AAChartSubtitleAlignType, subtitleAlign);//图表副标题文本水平对齐方式。可选的值有 “left”,”center“和“right”。 默认是:center.
  141. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, AAChartType, chartType);//图表类型
  142. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, AAChartStackingType, stacking);//堆积样式
  143. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, AAChartSymbolType, symbol);//折线曲线连接点的类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  144. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, AAChartSymbolStyleType, symbolStyle);
  145. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, AAChartZoomType, zoomType);//缩放类型 AAChartZoomTypeX 表示可沿着 x 轴进行手势缩放
  146. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, AAChartAnimation, animationType);//设置图表的渲染动画类型
  147. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, animationDuration);//设置图表的渲染动画时长(动画单位为毫秒)
  148. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, inverted);//x 轴是否垂直,默认为否
  149. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, gradientColorEnabled);//是否要为渐变色,默认为否
  150. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, polar);//是否极化图形(变为雷达图),默认为否
  151. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, dataLabelEnabled);//是否显示数据,默认为否
  152. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, dataLabelFontColor);//Datalabel font color
  153. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, dataLabelFontSize);//Datalabel font size
  154. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, dataLabelFontWeight);//Datalabel font weight
  155. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, xAxisVisible);//x 轴是否可见(默认可见)
  156. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, xAxisReversed);// x 轴翻转,默认为否
  157. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, xAxisLabelsEnabled);//x 轴是否显示文字
  158. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, xAxisLabelsFontSize);//x 轴文字字体大小
  159. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, xAxisLabelsFontColor);//x 轴文字字体颜色
  160. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, AAChartFontWeightType, xAxisLabelsFontWeight);//x 轴文字字体粗细
  161. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, xAxisGridLineWidth);//x 轴网格线的宽度
  162. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, xAxisTickInterval);//x轴刻度点间隔数(设置每隔几个点显示一个 X轴的内容)
  163. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, xAxisCrosshairWidth);//设置 x 轴准星线的宽度
  164. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, xAxisCrosshairColor);//设置 x 轴准星线的颜色
  165. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, AALineDashSyleType, xAxisCrosshairDashStyleType);//设置 x 轴准星线的线条样式类型
  166. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, yAxisVisible);//y 轴是否可见(默认可见)
  167. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, yAxisReversed);//y 轴翻转,默认为否
  168. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, yAxisLabelsEnabled);//y 轴是否显示文字
  169. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, yAxisLabelsFontSize);//y 轴文字字体大小
  170. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, yAxisLabelsFontColor);//y 轴文字字体颜色
  171. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, AAChartFontWeightType , yAxisLabelsFontWeight);//y 轴文字字体粗细
  172. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, yAxisTitle);//y 轴标题
  173. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, yAxisLineWidth);//y y-axis line width
  174. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, yAxisGridLineWidth);//y轴网格线的宽度
  175. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, yAxisAllowDecimals);//是否允许 y 轴显示小数
  176. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSArray *, yAxisPlotLines);//y 轴基线的配置
  177. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, yAxisMax);//y 轴最大值
  178. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, yAxisMin);//y 轴最小值(设置为0就不会有负数)
  179. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, yAxisTickInterval);
  180. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSArray *, yAxisTickPositions);//自定义 y 轴坐标(如:[@(0), @(25), @(50), @(75) , (100)])
  181. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, yAxisCrosshairWidth);//设置 y 轴准星线的宽度
  182. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, yAxisCrosshairColor);//设置 y 轴准星线的颜色
  183. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, AALineDashSyleType, yAxisCrosshairDashStyleType);//设置 y 轴准星线的线条样式类型
  184. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, tooltipEnabled);//是否显示浮动提示框(默认显示)
  185. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, tooltipShared)//是否多组数据共享一个浮动提示框
  186. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, tooltipValueSuffix);//浮动提示框单位后缀
  187. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, connectNulls);//设置折线是否断点重连(是否连接空值点)
  188. AAPropStatementAndPropSetFuncStatement(assign, AAChartModel, BOOL, legendEnabled);//是否显示图例 lengend(图表底部可点按的圆点和文字)
  189. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, borderRadius);//柱状图长条图头部圆角半径(可用于设置头部的形状,仅对条形图,柱状图有效)
  190. AAPropStatementAndPropSetFuncStatement(strong, AAChartModel, NSNumber *, markerRadius);//折线连接点的半径长度
  191. AAPropStatementAndPropSetFuncStatement(copy, AAChartModel, NSString *, zoomResetButtonText); //String to display in 'zoom reset button"
  192. @end