macarons.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. (function(root, factory) {
  20. if (typeof define === 'function' && define.amd) {
  21. // AMD. Register as an anonymous module.
  22. define(['exports', 'echarts'], factory);
  23. } else if (
  24. typeof exports === 'object' &&
  25. typeof exports.nodeName !== 'string'
  26. ) {
  27. // CommonJS
  28. factory(exports, require('echarts/lib/echarts'));
  29. } else {
  30. // Browser globals
  31. factory({}, root.echarts);
  32. }
  33. })(this, function(exports, echarts) {
  34. var log = function(msg) {
  35. if (typeof console !== 'undefined') {
  36. console && console.error && console.error(msg);
  37. }
  38. };
  39. if (!echarts) {
  40. log('ECharts is not Loaded');
  41. return;
  42. }
  43. var colorPalette = [
  44. '#2ec7c9',
  45. '#b6a2de',
  46. '#5ab1ef',
  47. '#ffb980',
  48. '#d87a80',
  49. '#8d98b3',
  50. '#e5cf0d',
  51. '#97b552',
  52. '#95706d',
  53. '#dc69aa',
  54. '#07a2a4',
  55. '#9a7fd1',
  56. '#588dd5',
  57. '#f5994e',
  58. '#c05050',
  59. '#59678c',
  60. '#c9ab00',
  61. '#7eb00a',
  62. '#6f5553',
  63. '#c14089'
  64. ];
  65. var theme = {
  66. color: colorPalette,
  67. title: {
  68. textStyle: {
  69. fontWeight: 'normal',
  70. color: '#008acd'
  71. }
  72. },
  73. visualMap: {
  74. itemWidth: 15,
  75. color: ['#5ab1ef', '#e0ffff']
  76. },
  77. toolbox: {
  78. iconStyle: {
  79. borderColor: colorPalette[0]
  80. }
  81. },
  82. tooltip: {
  83. borderWidth: 0,
  84. backgroundColor: 'rgba(50,50,50,0.5)',
  85. textStyle: {
  86. color: '#FFF'
  87. },
  88. axisPointer: {
  89. type: 'line',
  90. lineStyle: {
  91. color: '#008acd'
  92. },
  93. crossStyle: {
  94. color: '#008acd'
  95. },
  96. shadowStyle: {
  97. color: 'rgba(200,200,200,0.2)'
  98. }
  99. }
  100. },
  101. dataZoom: {
  102. dataBackgroundColor: '#efefff',
  103. fillerColor: 'rgba(182,162,222,0.2)',
  104. handleColor: '#008acd'
  105. },
  106. grid: {
  107. borderColor: '#eee'
  108. },
  109. categoryAxis: {
  110. axisLine: {
  111. lineStyle: {
  112. color: '#008acd'
  113. }
  114. },
  115. splitLine: {
  116. lineStyle: {
  117. color: ['#eee']
  118. }
  119. }
  120. },
  121. valueAxis: {
  122. axisLine: {
  123. lineStyle: {
  124. color: '#008acd'
  125. }
  126. },
  127. splitArea: {
  128. show: true,
  129. areaStyle: {
  130. color: ['rgba(250,250,250,0.1)', 'rgba(200,200,200,0.1)']
  131. }
  132. },
  133. splitLine: {
  134. lineStyle: {
  135. color: ['#eee']
  136. }
  137. }
  138. },
  139. timeline: {
  140. lineStyle: {
  141. color: '#008acd'
  142. },
  143. controlStyle: {
  144. color: '#008acd',
  145. borderColor: '#008acd'
  146. },
  147. symbol: 'emptyCircle',
  148. symbolSize: 3
  149. },
  150. line: {
  151. smooth: true,
  152. symbol: 'emptyCircle',
  153. symbolSize: 3
  154. },
  155. candlestick: {
  156. itemStyle: {
  157. color: '#d87a80',
  158. color0: '#2ec7c9'
  159. },
  160. lineStyle: {
  161. width: 1,
  162. color: '#d87a80',
  163. color0: '#2ec7c9'
  164. },
  165. areaStyle: {
  166. color: '#2ec7c9',
  167. color0: '#b6a2de'
  168. }
  169. },
  170. scatter: {
  171. symbol: 'circle',
  172. symbolSize: 4
  173. },
  174. map: {
  175. itemStyle: {
  176. color: '#ddd'
  177. },
  178. areaStyle: {
  179. color: '#fe994e'
  180. },
  181. label: {
  182. color: '#d87a80'
  183. }
  184. },
  185. graph: {
  186. itemStyle: {
  187. color: '#d87a80'
  188. },
  189. linkStyle: {
  190. color: '#2ec7c9'
  191. }
  192. },
  193. gauge: {
  194. axisLine: {
  195. lineStyle: {
  196. color: [
  197. [0.2, '#2ec7c9'],
  198. [0.8, '#5ab1ef'],
  199. [1, '#d87a80']
  200. ],
  201. width: 10
  202. }
  203. },
  204. axisTick: {
  205. splitNumber: 10,
  206. length: 15,
  207. lineStyle: {
  208. color: 'auto'
  209. }
  210. },
  211. splitLine: {
  212. length: 22,
  213. lineStyle: {
  214. color: 'auto'
  215. }
  216. },
  217. pointer: {
  218. width: 5
  219. }
  220. }
  221. };
  222. echarts.registerTheme('macarons', theme);
  223. });