macarons.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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'));
  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. normal: {
  80. borderColor: colorPalette[0]
  81. }
  82. }
  83. },
  84. tooltip: {
  85. backgroundColor: 'rgba(50,50,50,0.5)',
  86. axisPointer: {
  87. type: 'line',
  88. lineStyle: {
  89. color: '#008acd'
  90. },
  91. crossStyle: {
  92. color: '#008acd'
  93. },
  94. shadowStyle: {
  95. color: 'rgba(200,200,200,0.2)'
  96. }
  97. }
  98. },
  99. dataZoom: {
  100. dataBackgroundColor: '#efefff',
  101. fillerColor: 'rgba(182,162,222,0.2)',
  102. handleColor: '#008acd'
  103. },
  104. grid: {
  105. borderColor: '#eee'
  106. },
  107. categoryAxis: {
  108. axisLine: {
  109. lineStyle: {
  110. color: '#008acd'
  111. }
  112. },
  113. splitLine: {
  114. lineStyle: {
  115. color: ['#eee']
  116. }
  117. }
  118. },
  119. valueAxis: {
  120. axisLine: {
  121. lineStyle: {
  122. color: '#008acd'
  123. }
  124. },
  125. splitArea: {
  126. show: true,
  127. areaStyle: {
  128. color: ['rgba(250,250,250,0.1)', 'rgba(200,200,200,0.1)']
  129. }
  130. },
  131. splitLine: {
  132. lineStyle: {
  133. color: ['#eee']
  134. }
  135. }
  136. },
  137. timeline: {
  138. lineStyle: {
  139. color: '#008acd'
  140. },
  141. controlStyle: {
  142. color: '#008acd',
  143. borderColor: '#008acd'
  144. },
  145. symbol: 'emptyCircle',
  146. symbolSize: 3
  147. },
  148. line: {
  149. smooth: true,
  150. symbol: 'emptyCircle',
  151. symbolSize: 3
  152. },
  153. candlestick: {
  154. itemStyle: {
  155. color: '#d87a80',
  156. color0: '#2ec7c9'
  157. },
  158. lineStyle: {
  159. width: 1,
  160. color: '#d87a80',
  161. color0: '#2ec7c9'
  162. },
  163. areaStyle: {
  164. color: '#2ec7c9',
  165. color0: '#b6a2de'
  166. }
  167. },
  168. scatter: {
  169. symbol: 'circle',
  170. symbolSize: 4
  171. },
  172. map: {
  173. itemStyle: {
  174. color: '#ddd'
  175. },
  176. areaStyle: {
  177. color: '#fe994e'
  178. },
  179. label: {
  180. color: '#d87a80'
  181. }
  182. },
  183. graph: {
  184. itemStyle: {
  185. color: '#d87a80'
  186. },
  187. linkStyle: {
  188. color: '#2ec7c9'
  189. }
  190. },
  191. gauge: {
  192. axisLine: {
  193. lineStyle: {
  194. color: [
  195. [0.2, '#2ec7c9'],
  196. [0.8, '#5ab1ef'],
  197. [1, '#d87a80']
  198. ],
  199. width: 10
  200. }
  201. },
  202. axisTick: {
  203. splitNumber: 10,
  204. length: 15,
  205. lineStyle: {
  206. color: 'auto'
  207. }
  208. },
  209. splitLine: {
  210. length: 22,
  211. lineStyle: {
  212. color: 'auto'
  213. }
  214. },
  215. pointer: {
  216. width: 5
  217. }
  218. }
  219. };
  220. echarts.registerTheme('macarons', theme);
  221. });