macarons.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. (function (root, factory) {
  2. 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. '#2ec7c9','#b6a2de','#5ab1ef','#ffb980','#d87a80',
  24. '#8d98b3','#e5cf0d','#97b552','#95706d','#dc69aa',
  25. '#07a2a4','#9a7fd1','#588dd5','#f5994e','#c05050',
  26. '#59678c','#c9ab00','#7eb00a','#6f5553','#c14089'
  27. ];
  28. var theme = {
  29. // 默认色板
  30. color: [
  31. '#c12e34','#e6b600','#0098d9','#2b821d',
  32. '#005eaa','#339ca8','#cda819','#32a487'
  33. ],
  34. // 图表标题
  35. title: {
  36. textStyle: {
  37. fontWeight: 'normal'
  38. }
  39. },
  40. // 值域
  41. dataRange: {
  42. itemWidth: 15, // 值域图形宽度,线性渐变水平布局宽度为该值 * 10
  43. color:['#1790cf','#a2d4e6']
  44. },
  45. // 工具箱
  46. toolbox: {
  47. color : ['#06467c','#00613c','#872d2f','#c47630']
  48. },
  49. // 提示框
  50. tooltip: {
  51. backgroundColor: 'rgba(0,0,0,0.6)'
  52. },
  53. // 区域缩放控制器
  54. dataZoom: {
  55. dataBackgroundColor: '#dedede', // 数据背景颜色
  56. fillerColor: 'rgba(154,217,247,0.2)', // 填充颜色
  57. handleColor: '#005eaa' // 手柄颜色
  58. },
  59. // 网格
  60. grid: {
  61. borderWidth: 0
  62. },
  63. // 类目轴
  64. categoryAxis: {
  65. axisLine: { // 坐标轴线
  66. show: false
  67. },
  68. axisTick: { // 坐标轴小标记
  69. show: false
  70. }
  71. },
  72. // 数值型坐标轴默认参数
  73. valueAxis: {
  74. axisLine: { // 坐标轴线
  75. show: false
  76. },
  77. axisTick: { // 坐标轴小标记
  78. show: false
  79. },
  80. splitArea: { // 分隔区域
  81. show: true, // 默认不显示,属性show控制显示与否
  82. areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式
  83. color: ['rgba(250,250,250,0.2)','rgba(200,200,200,0.2)']
  84. }
  85. }
  86. },
  87. timeline : {
  88. lineStyle : {
  89. color : '#005eaa'
  90. },
  91. controlStyle : {
  92. normal : { color : '#005eaa'},
  93. emphasis : { color : '#005eaa'}
  94. }
  95. },
  96. // K线图默认参数
  97. k: {
  98. itemStyle: {
  99. normal: {
  100. color: '#c12e34', // 阳线填充颜色
  101. color0: '#2b821d', // 阴线填充颜色
  102. lineStyle: {
  103. width: 1,
  104. color: '#c12e34', // 阳线边框颜色
  105. color0: '#2b821d' // 阴线边框颜色
  106. }
  107. }
  108. }
  109. },
  110. map: {
  111. itemStyle: {
  112. normal: {
  113. areaStyle: {
  114. color: '#ddd'
  115. },
  116. label: {
  117. textStyle: {
  118. color: '#c12e34'
  119. }
  120. }
  121. },
  122. emphasis: { // 也是选中样式
  123. areaStyle: {
  124. color: '#e6b600'
  125. },
  126. label: {
  127. textStyle: {
  128. color: '#c12e34'
  129. }
  130. }
  131. }
  132. }
  133. },
  134. force : {
  135. itemStyle: {
  136. normal: {
  137. linkStyle : {
  138. color : '#005eaa'
  139. }
  140. }
  141. }
  142. },
  143. chord : {
  144. itemStyle : {
  145. normal : {
  146. borderWidth: 0,
  147. borderColor: 'rgba(128, 128, 128, 0.5)',
  148. chordStyle : {
  149. lineStyle : {
  150. color : 'rgba(128, 128, 128, 0.5)'
  151. }
  152. }
  153. },
  154. emphasis : {
  155. borderWidth: 0,
  156. borderColor: 'rgba(128, 128, 128, 0.5)',
  157. chordStyle : {
  158. lineStyle : {
  159. color : 'rgba(128, 128, 128, 0.5)'
  160. }
  161. }
  162. }
  163. }
  164. },
  165. gauge : {
  166. axisLine: { // 坐标轴线
  167. show: true, // 默认显示,属性show控制显示与否
  168. lineStyle: { // 属性lineStyle控制线条样式
  169. color: [[0.2, '#2b821d'],[0.8, '#005eaa'],[1, '#c12e34']],
  170. width: 5
  171. }
  172. },
  173. axisTick: { // 坐标轴小标记
  174. splitNumber: 10, // 每份split细分多少段
  175. length :8, // 属性length控制线长
  176. lineStyle: { // 属性lineStyle控制线条样式
  177. color: 'auto'
  178. }
  179. },
  180. axisLabel: { // 坐标轴文本标签,详见axis.axisLabel
  181. textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  182. color: 'auto'
  183. }
  184. },
  185. splitLine: { // 分隔线
  186. length : 12, // 属性length控制线长
  187. lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
  188. color: 'auto'
  189. }
  190. },
  191. pointer : {
  192. length : '90%',
  193. width : 3,
  194. color : 'auto'
  195. },
  196. title : {
  197. textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  198. color: '#333'
  199. }
  200. },
  201. detail : {
  202. textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  203. color: 'auto'
  204. }
  205. }
  206. },
  207. textStyle: {
  208. fontFamily: '微软雅黑, Arial, Verdana, sans-serif'
  209. }
  210. };
  211. echarts.registerTheme('macarons', theme);
  212. }));