bee-inspired.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. '#001727',
  45. '#805500',
  46. '#ffff00',
  47. '#ffd11a',
  48. '#f2d71f',
  49. '#f2be19',
  50. '#f3a81a',
  51. '#fff5cc'
  52. ];
  53. var theme = {
  54. color: colorPalette,
  55. title: {
  56. textStyle: {
  57. fontWeight: 'normal',
  58. color: '#001727'
  59. }
  60. },
  61. visualMap: {
  62. color: ['#001727', '#805500']
  63. },
  64. toolbox: {
  65. color: ['#001727', '#001727', '#001727', '#001727']
  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: '#001727',
  75. type: 'dashed'
  76. },
  77. crossStyle: {
  78. color: '#001727'
  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(200,200,200,0.2)', // Fill the color
  90. handleColor: '#001727' // Handle color
  91. },
  92. timeline: {
  93. lineStyle: {
  94. color: '#001727'
  95. },
  96. controlStyle: {
  97. color: '#001727',
  98. borderColor: '#001727'
  99. }
  100. },
  101. candlestick: {
  102. itemStyle: {
  103. color: '#f3a81a',
  104. color0: '#ffff00'
  105. },
  106. lineStyle: {
  107. width: 1,
  108. color: '#ffff00',
  109. color0: '#f3a81a'
  110. },
  111. areaStyle: {
  112. color: '#805500',
  113. color0: '#ffff00'
  114. }
  115. },
  116. chord: {
  117. padding: 4,
  118. itemStyle: {
  119. color: '#f3a81a',
  120. borderWidth: 1,
  121. borderColor: 'rgba(128, 128, 128, 0.5)'
  122. },
  123. lineStyle: {
  124. color: 'rgba(128, 128, 128, 0.5)'
  125. },
  126. areaStyle: {
  127. color: '#805500'
  128. }
  129. },
  130. map: {
  131. itemStyle: {
  132. color: '#ffd11a'
  133. },
  134. areaStyle: {
  135. color: '#f2be19'
  136. },
  137. label: {
  138. color: '#ffd11a'
  139. }
  140. },
  141. graph: {
  142. itemStyle: {
  143. color: '#001727'
  144. },
  145. linkStyle: {
  146. color: '#001727'
  147. }
  148. },
  149. gauge: {
  150. axisLine: {
  151. lineStyle: {
  152. color: [
  153. [0.2, '#f2d71f'],
  154. [0.8, '#001727'],
  155. [1, '#ffff00']
  156. ],
  157. width: 8
  158. }
  159. }
  160. }
  161. };
  162. echarts.registerTheme('bee-inspired', theme);
  163. });