shine.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. '#c12e34',
  45. '#e6b600',
  46. '#0098d9',
  47. '#2b821d',
  48. '#005eaa',
  49. '#339ca8',
  50. '#cda819',
  51. '#32a487'
  52. ];
  53. var theme = {
  54. color: colorPalette,
  55. title: {
  56. textStyle: {
  57. fontWeight: 'normal'
  58. }
  59. },
  60. visualMap: {
  61. color: ['#1790cf', '#a2d4e6']
  62. },
  63. toolbox: {
  64. iconStyle: {
  65. normal: {
  66. borderColor: '#06467c'
  67. }
  68. }
  69. },
  70. tooltip: {
  71. backgroundColor: 'rgba(0,0,0,0.6)'
  72. },
  73. dataZoom: {
  74. dataBackgroundColor: '#dedede',
  75. fillerColor: 'rgba(154,217,247,0.2)',
  76. handleColor: '#005eaa'
  77. },
  78. timeline: {
  79. lineStyle: {
  80. color: '#005eaa'
  81. },
  82. controlStyle: {
  83. color: '#005eaa',
  84. borderColor: '#005eaa'
  85. }
  86. },
  87. candlestick: {
  88. itemStyle: {
  89. color: '#c12e34',
  90. color0: '#2b821d'
  91. },
  92. lineStyle: {
  93. width: 1,
  94. color: '#c12e34',
  95. color0: '#2b821d'
  96. },
  97. areaStyle: {
  98. color: '#e6b600',
  99. color0: '#005eaa'
  100. }
  101. },
  102. graph: {
  103. itemStyle: {
  104. color: '#e6b600'
  105. },
  106. linkStyle: {
  107. color: '#005eaa'
  108. }
  109. },
  110. map: {
  111. itemStyle: {
  112. color: '#f2385a',
  113. borderColor: '#eee',
  114. areaColor: '#ddd'
  115. },
  116. areaStyle: {
  117. color: '#ddd'
  118. },
  119. label: {
  120. color: '#c12e34'
  121. }
  122. },
  123. gauge: {
  124. axisLine: {
  125. show: true,
  126. lineStyle: {
  127. color: [
  128. [0.2, '#2b821d'],
  129. [0.8, '#005eaa'],
  130. [1, '#c12e34']
  131. ],
  132. width: 5
  133. }
  134. },
  135. axisTick: {
  136. splitNumber: 10,
  137. length: 8,
  138. lineStyle: {
  139. color: 'auto'
  140. }
  141. },
  142. axisLabel: {
  143. textStyle: {
  144. color: 'auto'
  145. }
  146. },
  147. splitLine: {
  148. length: 12,
  149. lineStyle: {
  150. color: 'auto'
  151. }
  152. },
  153. pointer: {
  154. length: '90%',
  155. width: 3,
  156. color: 'auto'
  157. },
  158. title: {
  159. textStyle: {
  160. color: '#333'
  161. }
  162. },
  163. detail: {
  164. textStyle: {
  165. color: 'auto'
  166. }
  167. }
  168. }
  169. };
  170. echarts.registerTheme('shine', theme);
  171. });