gray.js 5.8 KB

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