infographic.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /* */
  2. (function (root, factory) {if (typeof define === 'function' && define.amd) {
  3. // AMD. Register as an anonymous module.
  4. define(['exports', 'echarts'], factory);
  5. } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
  6. // CommonJS
  7. factory(exports, require('echarts'));
  8. } else {
  9. // Browser globals
  10. factory({}, root.echarts);
  11. }
  12. }(this, function (exports, echarts) {
  13. var log = function (msg) {
  14. if (typeof console !== 'undefined') {
  15. console && console.error && console.error(msg);
  16. }
  17. };
  18. if (!echarts) {
  19. log('ECharts is not Loaded');
  20. return;
  21. }
  22. var colorPalette = [
  23. '#C1232B','#27727B','#FCCE10','#E87C25','#B5C334',
  24. '#FE8463','#9BCA63','#FAD860','#F3A43B','#60C0DD',
  25. '#D7504B','#C6E579','#F4E001','#F0805A','#26C0C0'
  26. ];
  27. var theme = {
  28. color: colorPalette,
  29. title: {
  30. textStyle: {
  31. fontWeight: 'normal',
  32. color: '#27727B'
  33. }
  34. },
  35. visualMap: {
  36. color:['#C1232B','#FCCE10']
  37. },
  38. toolbox: {
  39. iconStyle: {
  40. normal: {
  41. borderColor: colorPalette[0]
  42. }
  43. }
  44. },
  45. tooltip: {
  46. backgroundColor: 'rgba(50,50,50,0.5)',
  47. axisPointer : {
  48. type : 'line',
  49. lineStyle : {
  50. color: '#27727B',
  51. type: 'dashed'
  52. },
  53. crossStyle: {
  54. color: '#27727B'
  55. },
  56. shadowStyle : {
  57. color: 'rgba(200,200,200,0.3)'
  58. }
  59. }
  60. },
  61. dataZoom: {
  62. dataBackgroundColor: 'rgba(181,195,52,0.3)',
  63. fillerColor: 'rgba(181,195,52,0.2)',
  64. handleColor: '#27727B'
  65. },
  66. categoryAxis: {
  67. axisLine: {
  68. lineStyle: {
  69. color: '#27727B'
  70. }
  71. },
  72. splitLine: {
  73. show: false
  74. }
  75. },
  76. valueAxis: {
  77. axisLine: {
  78. show: false
  79. },
  80. splitArea : {
  81. show: false
  82. },
  83. splitLine: {
  84. lineStyle: {
  85. color: ['#ccc'],
  86. type: 'dashed'
  87. }
  88. }
  89. },
  90. timeline: {
  91. lineStyle: {
  92. color: '#27727B'
  93. },
  94. controlStyle: {
  95. normal: {
  96. color: '#27727B',
  97. borderColor: '#27727B'
  98. }
  99. },
  100. symbol: 'emptyCircle',
  101. symbolSize: 3
  102. },
  103. line: {
  104. itemStyle: {
  105. normal: {
  106. borderWidth:2,
  107. borderColor:'#fff',
  108. lineStyle: {
  109. width: 3
  110. }
  111. },
  112. emphasis: {
  113. borderWidth:0
  114. }
  115. },
  116. symbol: 'circle',
  117. symbolSize: 3.5
  118. },
  119. candlestick: {
  120. itemStyle: {
  121. normal: {
  122. color: '#C1232B',
  123. color0: '#B5C334',
  124. lineStyle: {
  125. width: 1,
  126. color: '#C1232B',
  127. color0: '#B5C334'
  128. }
  129. }
  130. }
  131. },
  132. graph: {
  133. color: colorPalette
  134. },
  135. map: {
  136. label: {
  137. normal: {
  138. textStyle: {
  139. color: '#C1232B'
  140. }
  141. },
  142. emphasis: {
  143. textStyle: {
  144. color: 'rgb(100,0,0)'
  145. }
  146. }
  147. },
  148. itemStyle: {
  149. normal: {
  150. areaColor: '#ddd',
  151. borderColor: '#eee'
  152. },
  153. emphasis: {
  154. areaColor: '#fe994e'
  155. }
  156. }
  157. },
  158. gauge: {
  159. axisLine: {
  160. lineStyle: {
  161. color: [[0.2, '#B5C334'],[0.8, '#27727B'],[1, '#C1232B']]
  162. }
  163. },
  164. axisTick: {
  165. splitNumber: 2,
  166. length: 5,
  167. lineStyle: {
  168. color: '#fff'
  169. }
  170. },
  171. axisLabel: {
  172. textStyle: {
  173. color: '#fff'
  174. }
  175. },
  176. splitLine: {
  177. length: '5%',
  178. lineStyle: {
  179. color: '#fff'
  180. }
  181. },
  182. title : {
  183. offsetCenter: [0, -20]
  184. }
  185. }
  186. };
  187. echarts.registerTheme('infographic', theme);
  188. }));