cool.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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. '#b21ab4',
  45. '#6f0099',
  46. '#2a2073',
  47. '#0b5ea8',
  48. '#17aecc',
  49. '#b3b3ff',
  50. '#eb99ff',
  51. '#fae6ff',
  52. '#e6f2ff',
  53. '#eeeeee'
  54. ];
  55. var theme = {
  56. color: colorPalette,
  57. title: {
  58. textStyle: {
  59. fontWeight: 'normal',
  60. color: '#00aecd'
  61. }
  62. },
  63. visualMap: {
  64. color: ['#00aecd', '#a2d4e6']
  65. },
  66. toolbox: {
  67. color: ['#00aecd', '#00aecd', '#00aecd', '#00aecd']
  68. },
  69. tooltip: {
  70. backgroundColor: 'rgba(0,0,0,0.5)',
  71. axisPointer: {
  72. // Axis indicator, coordinate trigger effective
  73. type: 'line', // The default is a straight line: 'line' | 'shadow'
  74. lineStyle: {
  75. // Straight line indicator style settings
  76. color: '#00aecd',
  77. type: 'dashed'
  78. },
  79. crossStyle: {
  80. color: '#00aecd'
  81. },
  82. shadowStyle: {
  83. // Shadow indicator style settings
  84. color: 'rgba(200,200,200,0.3)'
  85. }
  86. }
  87. },
  88. // Area scaling controller
  89. dataZoom: {
  90. dataBackgroundColor: '#eee', // Data background color
  91. fillerColor: 'rgba(144,197,237,0.2)', // Fill the color
  92. handleColor: '#00aecd' // Handle color
  93. },
  94. timeline: {
  95. lineStyle: {
  96. color: '#00aecd'
  97. },
  98. controlStyle: {
  99. color: '#00aecd',
  100. borderColor: '00aecd'
  101. }
  102. },
  103. candlestick: {
  104. itemStyle: {
  105. color: '#00aecd',
  106. color0: '#a2d4e6'
  107. },
  108. lineStyle: {
  109. width: 1,
  110. color: '#00aecd',
  111. color0: '#a2d4e6'
  112. },
  113. areaStyle: {
  114. color: '#b21ab4',
  115. color0: '#0b5ea8'
  116. }
  117. },
  118. chord: {
  119. padding: 4,
  120. itemStyle: {
  121. color: '#b21ab4',
  122. borderWidth: 1,
  123. borderColor: 'rgba(128, 128, 128, 0.5)'
  124. },
  125. lineStyle: {
  126. color: 'rgba(128, 128, 128, 0.5)'
  127. },
  128. areaStyle: {
  129. color: '#0b5ea8'
  130. }
  131. },
  132. graph: {
  133. itemStyle: {
  134. color: '#b21ab4'
  135. },
  136. linkStyle: {
  137. color: '#2a2073'
  138. }
  139. },
  140. map: {
  141. itemStyle: {
  142. color: '#c12e34'
  143. },
  144. areaStyle: {
  145. color: '#ddd'
  146. },
  147. label: {
  148. color: '#c12e34'
  149. }
  150. },
  151. gauge: {
  152. axisLine: {
  153. lineStyle: {
  154. color: [
  155. [0.2, '#dddddd'],
  156. [0.8, '#00aecd'],
  157. [1, '#f5ccff']
  158. ],
  159. width: 8
  160. }
  161. }
  162. }
  163. };
  164. echarts.registerTheme('cool', theme);
  165. });