3be9fbf9dd0fbfad9cfab9d97bd29bf5f090cc554987ed31f98b9f06e980c56dc4b21c8b75756108e84e3ca7b54b2ec4553faedd1bb564934d4aa7ee411ff6 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. export const gaugeConfig = {
  2. /**
  3. * @description Whether to display this gauge
  4. * @type {Boolean}
  5. * @default show = true
  6. */
  7. show: true,
  8. /**
  9. * @description Legend name
  10. * @type {String}
  11. * @default name = ''
  12. */
  13. name: '',
  14. /**
  15. * @description Radius of gauge
  16. * @type {String|Number}
  17. * @default radius = '60%'
  18. * @example radius = '60%' | 100
  19. */
  20. radius: '60%',
  21. /**
  22. * @description Center point of gauge
  23. * @type {Array}
  24. * @default center = ['50%','50%']
  25. * @example center = ['50%','50%'] | [100, 100]
  26. */
  27. center: ['50%', '50%'],
  28. /**
  29. * @description Gauge start angle
  30. * @type {Number}
  31. * @default startAngle = -(Math.PI / 4) * 5
  32. * @example startAngle = -Math.PI
  33. */
  34. startAngle: -(Math.PI / 4) * 5,
  35. /**
  36. * @description Gauge end angle
  37. * @type {Number}
  38. * @default endAngle = Math.PI / 4
  39. * @example endAngle = 0
  40. */
  41. endAngle: Math.PI / 4,
  42. /**
  43. * @description Gauge min value
  44. * @type {Number}
  45. * @default min = 0
  46. */
  47. min: 0,
  48. /**
  49. * @description Gauge max value
  50. * @type {Number}
  51. * @default max = 100
  52. */
  53. max: 100,
  54. /**
  55. * @description Gauge split number
  56. * @type {Number}
  57. * @default splitNum = 5
  58. */
  59. splitNum: 5,
  60. /**
  61. * @description Gauge arc line width
  62. * @type {Number}
  63. * @default arcLineWidth = 15
  64. */
  65. arcLineWidth: 15,
  66. /**
  67. * @description Gauge chart data
  68. * @type {Array}
  69. * @default data = []
  70. */
  71. data: [],
  72. /**
  73. * @description Data item arc default style configuration
  74. * @type {Object}
  75. * @default dataItemStyle = {Configuration Of Class Style}
  76. */
  77. dataItemStyle: {
  78. },
  79. /**
  80. * @description Axis tick configuration
  81. * @type {Object}
  82. */
  83. axisTick: {
  84. /**
  85. * @description Whether to display axis tick
  86. * @type {Boolean}
  87. * @default show = true
  88. */
  89. show: true,
  90. /**
  91. * @description Axis tick length
  92. * @type {Number}
  93. * @default tickLength = 6
  94. */
  95. tickLength: 6,
  96. /**
  97. * @description Axis tick default style configuration
  98. * @type {Object}
  99. * @default style = {Configuration Of Class Style}
  100. */
  101. style: {
  102. stroke: '#999',
  103. lineWidth: 1
  104. }
  105. },
  106. /**
  107. * @description Axis label configuration
  108. * @type {Object}
  109. */
  110. axisLabel: {
  111. /**
  112. * @description Whether to display axis label
  113. * @type {Boolean}
  114. * @default show = true
  115. */
  116. show: true,
  117. /**
  118. * @description Axis label data (Can be calculated automatically)
  119. * @type {Array}
  120. * @default data = [Number...]
  121. */
  122. data: [],
  123. /**
  124. * @description Axis label formatter
  125. * @type {String|Function}
  126. * @default formatter = null
  127. * @example formatter = '{value}%'
  128. * @example formatter = (labelItem) => (labelItem.value)
  129. */
  130. formatter: null,
  131. /**
  132. * @description Axis label gap between label and axis tick
  133. * @type {String|Function}
  134. * @default labelGap = 5
  135. */
  136. labelGap: 5,
  137. /**
  138. * @description Axis label default style configuration
  139. * @type {Object}
  140. * @default style = {Configuration Of Class Style}
  141. */
  142. style: {}
  143. },
  144. /**
  145. * @description Gauge pointer configuration
  146. * @type {Object}
  147. */
  148. pointer: {
  149. /**
  150. * @description Whether to display pointer
  151. * @type {Boolean}
  152. * @default show = true
  153. */
  154. show: true,
  155. /**
  156. * @description Pointer value index of data
  157. * @type {Number}
  158. * @default valueIndex = 0 (pointer.value = data[0].value)
  159. */
  160. valueIndex: 0,
  161. /**
  162. * @description Pointer default style configuration
  163. * @type {Object}
  164. * @default style = {Configuration Of Class Style}
  165. */
  166. style: {
  167. scale: [1, 1],
  168. fill: '#fb7293'
  169. }
  170. },
  171. /**
  172. * @description Data item arc detail configuration
  173. * @type {Object}
  174. */
  175. details: {
  176. /**
  177. * @description Whether to display details
  178. * @type {Boolean}
  179. * @default show = false
  180. */
  181. show: false,
  182. /**
  183. * @description Details formatter
  184. * @type {String|Function}
  185. * @default formatter = null
  186. * @example formatter = '{value}%'
  187. * @example formatter = '{name}%'
  188. * @example formatter = (dataItem) => (dataItem.value)
  189. */
  190. formatter: null,
  191. /**
  192. * @description Details position offset
  193. * @type {Array}
  194. * @default offset = [0, 0]
  195. * @example offset = [10, 10]
  196. */
  197. offset: [0, 0],
  198. /**
  199. * @description Value fractional precision
  200. * @type {Number}
  201. * @default valueToFixed = 0
  202. */
  203. valueToFixed: 0,
  204. /**
  205. * @description Details position
  206. * @type {String}
  207. * @default position = 'center'
  208. * @example position = 'start' | 'center' | 'end'
  209. */
  210. position: 'center',
  211. /**
  212. * @description Details default style configuration
  213. * @type {Object}
  214. * @default style = {Configuration Of Class Style}
  215. */
  216. style: {
  217. fontSize: 20,
  218. fontWeight: 'bold',
  219. textAlign: 'center',
  220. textBaseline: 'middle'
  221. }
  222. },
  223. /**
  224. * @description Gauge background arc configuration
  225. * @type {Object}
  226. */
  227. backgroundArc: {
  228. /**
  229. * @description Whether to display background arc
  230. * @type {Boolean}
  231. * @default show = true
  232. */
  233. show: true,
  234. /**
  235. * @description Background arc default style configuration
  236. * @type {Object}
  237. * @default style = {Configuration Of Class Style}
  238. */
  239. style: {
  240. stroke: '#e0e0e0'
  241. }
  242. },
  243. /**
  244. * @description Gauge chart render level
  245. * Priority rendering high level
  246. * @type {Number}
  247. * @default rLevel = 10
  248. */
  249. rLevel: 10,
  250. /**
  251. * @description Gauge animation curve
  252. * @type {String}
  253. * @default animationCurve = 'easeOutCubic'
  254. */
  255. animationCurve: 'easeOutCubic',
  256. /**
  257. * @description Gauge animation frame
  258. * @type {Number}
  259. * @default animationFrame = 50
  260. */
  261. animationFrame: 50,
  262. }