macarons.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. (function (root, factory) {
  2. if (typeof define === 'function' && define.amd) {
  3. // AMD. Register as an anonymous module.
  4. define(['exports', './echarts'], factory)
  5. }
  6. else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
  7. // CommonJS
  8. factory(exports, require('./echarts'))
  9. }
  10. else {
  11. // Browser globals
  12. factory({}, root.echarts)
  13. }
  14. }(this, function (exports, echarts) {
  15. var log = function (msg) {
  16. if (typeof console !== 'undefined') {
  17. console && console.error && console.error(msg)
  18. }
  19. }
  20. if (!echarts) {
  21. log('ECharts is not Loaded')
  22. return
  23. }
  24. var colorPalette = [
  25. '#2ec7c9', '#b6a2de', '#5ab1ef', '#ffb980', '#d87a80',
  26. '#8d98b3', '#e5cf0d', '#97b552', '#95706d', '#dc69aa',
  27. '#07a2a4', '#9a7fd1', '#588dd5', '#f5994e', '#c05050',
  28. '#59678c', '#c9ab00', '#7eb00a', '#6f5553', '#c14089'
  29. ]
  30. var theme = {
  31. color: colorPalette,
  32. title: {
  33. textStyle: {
  34. fontWeight: 'normal',
  35. color: '#008acd'
  36. }
  37. },
  38. visualMap: {
  39. itemWidth: 15,
  40. color: ['#5ab1ef', '#e0ffff']
  41. },
  42. toolbox: {
  43. iconStyle: {
  44. normal: {
  45. borderColor: colorPalette[0]
  46. }
  47. }
  48. },
  49. tooltip: {
  50. backgroundColor: 'rgba(50,50,50,0.5)',
  51. axisPointer: {
  52. type: 'line',
  53. lineStyle: {
  54. color: '#008acd'
  55. },
  56. crossStyle: {
  57. color: '#008acd'
  58. },
  59. shadowStyle: {
  60. color: 'rgba(200,200,200,0.2)'
  61. }
  62. }
  63. },
  64. dataZoom: {
  65. dataBackgroundColor: '#efefff',
  66. fillerColor: 'rgba(182,162,222,0.2)',
  67. handleColor: '#008acd'
  68. },
  69. grid: {
  70. borderColor: '#eee'
  71. },
  72. categoryAxis: {
  73. axisLine: {
  74. lineStyle: {
  75. color: '#008acd'
  76. }
  77. },
  78. splitLine: {
  79. lineStyle: {
  80. color: ['#eee']
  81. }
  82. }
  83. },
  84. valueAxis: {
  85. axisLine: {
  86. lineStyle: {
  87. color: '#008acd'
  88. }
  89. },
  90. splitArea: {
  91. show: true,
  92. areaStyle: {
  93. color: ['rgba(250,250,250,0.1)', 'rgba(200,200,200,0.1)']
  94. }
  95. },
  96. splitLine: {
  97. lineStyle: {
  98. color: ['#eee']
  99. }
  100. }
  101. },
  102. timeline: {
  103. lineStyle: {
  104. color: '#008acd'
  105. },
  106. controlStyle: {
  107. normal: {color: '#008acd'},
  108. emphasis: {color: '#008acd'}
  109. },
  110. symbol: 'emptyCircle',
  111. symbolSize: 3
  112. },
  113. line: {
  114. smooth: true,
  115. symbol: 'emptyCircle',
  116. symbolSize: 3
  117. },
  118. candlestick: {
  119. itemStyle: {
  120. normal: {
  121. color: '#d87a80',
  122. color0: '#2ec7c9',
  123. lineStyle: {
  124. color: '#d87a80',
  125. color0: '#2ec7c9'
  126. }
  127. }
  128. }
  129. },
  130. scatter: {
  131. symbol: 'circle',
  132. symbolSize: 4
  133. },
  134. map: {
  135. label: {
  136. normal: {
  137. textStyle: {
  138. color: '#d87a80'
  139. }
  140. }
  141. },
  142. itemStyle: {
  143. normal: {
  144. borderColor: '#eee',
  145. areaColor: '#ddd'
  146. },
  147. emphasis: {
  148. areaColor: '#fe994e'
  149. }
  150. }
  151. },
  152. graph: {
  153. color: colorPalette
  154. },
  155. gauge: {
  156. axisLine: {
  157. lineStyle: {
  158. color: [[0.2, '#2ec7c9'], [0.8, '#5ab1ef'], [1, '#d87a80']],
  159. width: 10
  160. }
  161. },
  162. axisTick: {
  163. splitNumber: 10,
  164. length: 15,
  165. lineStyle: {
  166. color: 'auto'
  167. }
  168. },
  169. splitLine: {
  170. length: 22,
  171. lineStyle: {
  172. color: 'auto'
  173. }
  174. },
  175. pointer: {
  176. width: 5
  177. }
  178. }
  179. }
  180. echarts.registerTheme('macarons', theme)
  181. }))