red.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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. '#d8361b',
  45. '#f16b4c',
  46. '#f7b4a9',
  47. '#d26666',
  48. '#99311c',
  49. '#c42703',
  50. '#d07e75'
  51. ];
  52. var theme = {
  53. color: colorPalette,
  54. title: {
  55. textStyle: {
  56. fontWeight: 'normal',
  57. color: '#d8361b'
  58. }
  59. },
  60. visualMap: {
  61. color: ['#d8361b', '#ffd2d2']
  62. },
  63. dataRange: {
  64. color: ['#bd0707', '#ffd2d2']
  65. },
  66. toolbox: {
  67. color: ['#d8361b', '#d8361b', '#d8361b', '#d8361b']
  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: '#d8361b',
  77. type: 'dashed'
  78. },
  79. crossStyle: {
  80. color: '#d8361b'
  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(216,54,27,0.2)', // Fill the color
  92. handleColor: '#d8361b' // Handle color
  93. },
  94. grid: {
  95. borderWidth: 0
  96. },
  97. categoryAxis: {
  98. axisLine: {
  99. // Coordinate axis
  100. lineStyle: {
  101. // Property 'lineStyle' controls line styles
  102. color: '#d8361b'
  103. }
  104. },
  105. splitLine: {
  106. // Separation line
  107. lineStyle: {
  108. // Property 'lineStyle' (see lineStyle) controls line styles
  109. color: ['#eee']
  110. }
  111. }
  112. },
  113. valueAxis: {
  114. axisLine: {
  115. // Coordinate axis
  116. lineStyle: {
  117. // Property 'lineStyle' controls line styles
  118. color: '#d8361b'
  119. }
  120. },
  121. splitArea: {
  122. show: true,
  123. areaStyle: {
  124. color: ['rgba(250,250,250,0.1)', 'rgba(200,200,200,0.1)']
  125. }
  126. },
  127. splitLine: {
  128. // Separation line
  129. lineStyle: {
  130. // Property 'lineStyle' (see lineStyle) controls line styles
  131. color: ['#eee']
  132. }
  133. }
  134. },
  135. timeline: {
  136. lineStyle: {
  137. color: '#d8361b'
  138. },
  139. controlStyle: {
  140. color: '#d8361b',
  141. borderColor: '#d8361b'
  142. }
  143. },
  144. candlestick: {
  145. itemStyle: {
  146. color: '#f16b4c',
  147. color0: '#f7b4a9'
  148. },
  149. lineStyle: {
  150. width: 1,
  151. color: '#d8361b',
  152. color0: '#d26666'
  153. },
  154. areaStyle: {
  155. color: '#d8361b',
  156. color0: '#d07e75'
  157. }
  158. },
  159. graph: {
  160. itemStyle: {
  161. color: '#d07e75'
  162. },
  163. linkStyle: {
  164. color: '#d8361b'
  165. }
  166. },
  167. chord: {
  168. padding: 4,
  169. itemStyle: {
  170. color: '#d07e75',
  171. borderWidth: 1,
  172. borderColor: 'rgba(128, 128, 128, 0.5)'
  173. },
  174. lineStyle: {
  175. color: 'rgba(128, 128, 128, 0.5)'
  176. },
  177. areaStyle: {
  178. color: '#d8361b'
  179. }
  180. },
  181. map: {
  182. itemStyle: {
  183. color: '#d8361b'
  184. },
  185. areaStyle: {
  186. color: '#d07e75'
  187. },
  188. label: {
  189. color: '#c12e34'
  190. }
  191. },
  192. gauge: {
  193. axisLine: {
  194. lineStyle: {
  195. color: [
  196. [0.2, '#f16b4c'],
  197. [0.8, '#d8361b'],
  198. [1, '#99311c']
  199. ],
  200. width: 8
  201. }
  202. }
  203. }
  204. };
  205. echarts.registerTheme('red', theme);
  206. });