helianthus.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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. '#44B7D3',
  45. '#E42B6D',
  46. '#F4E24E',
  47. '#FE9616',
  48. '#8AED35',
  49. '#ff69b4',
  50. '#ba55d3',
  51. '#cd5c5c',
  52. '#ffa500',
  53. '#40e0d0',
  54. '#E95569',
  55. '#ff6347',
  56. '#7b68ee',
  57. '#00fa9a',
  58. '#ffd700',
  59. '#6699FF',
  60. '#ff6666',
  61. '#3cb371',
  62. '#b8860b',
  63. '#30e0e0'
  64. ];
  65. var theme = {
  66. color: colorPalette,
  67. title: {
  68. textStyle: {
  69. fontWeight: 'normal',
  70. color: '#8A826D'
  71. }
  72. },
  73. dataRange: {
  74. x: 'right',
  75. y: 'center',
  76. itemWidth: 5,
  77. itemHeight: 25,
  78. color: ['#E42B6D', '#F9AD96'],
  79. text: ['High', 'Low'], // Text, default is numeric text
  80. textStyle: {
  81. color: '#8A826D' // Range text color
  82. }
  83. },
  84. toolbox: {
  85. color: ['#E95569', '#E95569', '#E95569', '#E95569'],
  86. effectiveColor: '#ff4500',
  87. itemGap: 8
  88. },
  89. tooltip: {
  90. backgroundColor: 'rgba(138,130,109,0.7)', // Prompt background color, default is black with a transparency of 0.7
  91. axisPointer: {
  92. // Axis indicator, coordinate trigger effective
  93. type: 'line', // The default is a straight line: 'line' | 'shadow'
  94. lineStyle: {
  95. // Straight line indicator style settings
  96. color: '#6B6455',
  97. type: 'dashed'
  98. },
  99. crossStyle: {
  100. color: '#A6A299'
  101. },
  102. shadowStyle: {
  103. // Shadow indicator style settings
  104. color: 'rgba(200,200,200,0.3)'
  105. }
  106. }
  107. },
  108. // Area scaling controller
  109. dataZoom: {
  110. dataBackgroundColor: 'rgba(130,197,209,0.6)', // Data background color
  111. fillerColor: 'rgba(233,84,105,0.1)', // Fill the color
  112. handleColor: 'rgba(107,99,84,0.8)' // Handle color
  113. },
  114. grid: {
  115. borderWidth: 0
  116. },
  117. categoryAxis: {
  118. axisLine: {
  119. // Coordinate axis
  120. lineStyle: {
  121. // Property 'lineStyle' controls line styles
  122. color: '#6B6455'
  123. }
  124. },
  125. splitLine: {
  126. // separate line
  127. show: false
  128. }
  129. },
  130. valueAxis: {
  131. axisLine: {
  132. // Coordinate axis
  133. show: true
  134. },
  135. splitArea: {
  136. show: false
  137. },
  138. splitLine: {
  139. // separate line
  140. lineStyle: {
  141. // Property 'lineStyle' controls line styles
  142. color: ['#FFF'],
  143. type: 'dashed'
  144. }
  145. }
  146. },
  147. polar: {
  148. axisLine: {
  149. // Coordinate axis
  150. lineStyle: {
  151. // // Property 'lineStyle' controls line styles
  152. color: '#ddd'
  153. }
  154. },
  155. splitArea: {
  156. show: true,
  157. areaStyle: {
  158. color: ['rgba(250,250,250,0.2)', 'rgba(200,200,200,0.2)']
  159. }
  160. },
  161. splitLine: {
  162. lineStyle: {
  163. color: '#ddd'
  164. }
  165. }
  166. },
  167. timeline: {
  168. lineStyle: {
  169. color: '#6B6455'
  170. },
  171. controlStyle: {
  172. color: '#6B6455',
  173. borderColor: '#6B6455'
  174. }
  175. },
  176. line: {
  177. smooth: true,
  178. symbol: 'emptyCircle', // Inflection point graphic type
  179. symbolSize: 3 // Inflection point graphic size
  180. },
  181. candlestick: {
  182. itemStyle: {
  183. color: '#e42B6d',
  184. color0: '#44B7d3'
  185. },
  186. lineStyle: {
  187. width: 1,
  188. color: '#e42B6d',
  189. color0: '#44B7d3'
  190. },
  191. areaStyle: {
  192. color: '#fe994e',
  193. color0: '#e42B6d'
  194. }
  195. },
  196. map: {
  197. itemStyle: {
  198. color: '#6b6455'
  199. },
  200. areaStyle: {
  201. color: '#ddd'
  202. },
  203. label: {
  204. color: '#e42B6d'
  205. }
  206. },
  207. graph: {
  208. itemStyle: {
  209. color: '#e42B6d'
  210. },
  211. linkStyle: {
  212. color: '#6b6455'
  213. }
  214. },
  215. chord: {
  216. padding: 4,
  217. itemStyle: {
  218. color: '#e42B6d',
  219. borderWidth: 1,
  220. borderColor: 'rgba(128, 128, 128, 0.5)'
  221. },
  222. lineStyle: {
  223. color: 'rgba(128, 128, 128, 0.5)'
  224. },
  225. areaStyle: {
  226. color: '#6b6455'
  227. }
  228. },
  229. gauge: {
  230. axisLine: {
  231. lineStyle: {
  232. color: [
  233. [0.2, '#44B7D3'],
  234. [0.8, '#6B6455'],
  235. [1, '#E42B6D']
  236. ],
  237. width: 8
  238. }
  239. }
  240. }
  241. };
  242. echarts.registerTheme('helianthus', theme);
  243. });