green.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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. '#408829',
  45. '#68a54a',
  46. '#a9cba2',
  47. '#86b379',
  48. '#397b29',
  49. '#8abb6f',
  50. '#759c6a',
  51. '#bfd3b7'
  52. ];
  53. var theme = {
  54. color: colorPalette,
  55. title: {
  56. textStyle: {
  57. fontWeight: 'normal',
  58. color: '#408829'
  59. }
  60. },
  61. visualMap: {
  62. color: ['408829', '#a9cba2']
  63. },
  64. toolbox: {
  65. color: ['#408829', '#408829', '#408829', '#408829']
  66. },
  67. tooltip: {
  68. backgroundColor: 'rgba(0,0,0,0.5)',
  69. axisPointer: {
  70. // Axis indicator, coordinate trigger effective
  71. type: 'line', // The default is a straight line: 'line' | 'shadow'
  72. lineStyle: {
  73. // Straight line indicator style settings
  74. color: '#408829',
  75. type: 'dashed'
  76. },
  77. crossStyle: {
  78. color: '#408829'
  79. },
  80. shadowStyle: {
  81. // Shadow indicator style settings
  82. color: 'rgba(200,200,200,0.3)'
  83. }
  84. }
  85. },
  86. // Area scaling controller
  87. dataZoom: {
  88. dataBackgroundColor: '#eee', // Data background color
  89. fillerColor: 'rgba(64,136,41,0.2)', // Fill the color
  90. handleColor: '#408829' // Handle color
  91. },
  92. grid: {
  93. borderWidth: 0
  94. },
  95. categoryAxis: {
  96. axisLine: {
  97. // Coordinate axis
  98. lineStyle: {
  99. // Property 'lineStyle' controls line styles
  100. color: '#408829'
  101. }
  102. },
  103. splitLine: {
  104. // Separation line
  105. lineStyle: {
  106. // Property 'lineStyle' (see lineStyle) controls line styles
  107. color: ['#eee']
  108. }
  109. }
  110. },
  111. valueAxis: {
  112. axisLine: {
  113. // Coordinate axis
  114. lineStyle: {
  115. // Property 'lineStyle' controls line styles
  116. color: '#408829'
  117. }
  118. },
  119. splitArea: {
  120. show: true,
  121. areaStyle: {
  122. color: ['rgba(250,250,250,0.1)', 'rgba(200,200,200,0.1)']
  123. }
  124. },
  125. splitLine: {
  126. // Separation line
  127. lineStyle: {
  128. // Property 'lineStyle' (see lineStyle) controls line styles
  129. color: ['#eee']
  130. }
  131. }
  132. },
  133. timeline: {
  134. lineStyle: {
  135. color: '#408829'
  136. },
  137. controlStyle: {
  138. color: '#408829',
  139. borderColor: '#408829'
  140. }
  141. },
  142. candlestick: {
  143. itemStyle: {
  144. color: '#68a54a',
  145. color0: '#a9cba2'
  146. },
  147. lineStyle: {
  148. width: 1,
  149. color: '#408829',
  150. color0: '#86b379'
  151. },
  152. areaStyle: {
  153. color: '#408829',
  154. color0: '#bfd3b7'
  155. }
  156. },
  157. graph: {
  158. itemStyle: {
  159. color: '#bfd3b7'
  160. },
  161. linkStyle: {
  162. color: '#408829'
  163. }
  164. },
  165. chord: {
  166. padding: 4,
  167. itemStyle: {
  168. color: '#bfd3b7',
  169. borderWidth: 1,
  170. borderColor: 'rgba(128, 128, 128, 0.5)'
  171. },
  172. lineStyle: {
  173. color: 'rgba(128, 128, 128, 0.5)'
  174. },
  175. areaStyle: {
  176. color: '#408829'
  177. }
  178. },
  179. map: {
  180. itemStyle: {
  181. color: '#ddd'
  182. },
  183. areaStyle: {
  184. color: '#408829'
  185. },
  186. label: {
  187. color: '#000'
  188. }
  189. },
  190. gauge: {
  191. axisLine: {
  192. lineStyle: {
  193. color: [
  194. [0.2, '#86b379'],
  195. [0.8, '#68a54a'],
  196. [1, '#408829']
  197. ],
  198. width: 8
  199. }
  200. }
  201. }
  202. };
  203. echarts.registerTheme('green', theme);
  204. });