macarons2.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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. '#ed9678',
  45. '#e7dac9',
  46. '#cb8e85',
  47. '#f3f39d',
  48. '#c8e49c',
  49. '#f16d7a',
  50. '#f3d999',
  51. '#d3758f',
  52. '#dcc392',
  53. '#2e4783',
  54. '#82b6e9',
  55. '#ff6347',
  56. '#a092f1',
  57. '#0a915d',
  58. '#eaf889',
  59. '#6699FF',
  60. '#ff6666',
  61. '#3cb371',
  62. '#d5b158',
  63. '#38b6b6'
  64. ];
  65. var theme = {
  66. color: colorPalette,
  67. title: {
  68. textStyle: {
  69. fontWeight: 'normal',
  70. color: '#cb8e85'
  71. }
  72. },
  73. dataRange: {
  74. color: ['#cb8e85', '#e7dac9'], //颜色
  75. //text:['高','低'], // 文本,默认为数值文本
  76. textStyle: {
  77. color: '#333' // 值域文字颜色
  78. }
  79. },
  80. bar: {
  81. barMinHeight: 0, // 最小高度改为0
  82. // barWidth: null, // 默认自适应
  83. barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值
  84. barCategoryGap: '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值
  85. label: {
  86. show: false
  87. // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
  88. // 'inside'|'left'|'right'|'top'|'bottom'
  89. // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
  90. },
  91. itemStyle: {
  92. // color: '各异',
  93. barBorderColor: '#fff', // 柱条边线
  94. barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0
  95. barBorderWidth: 1 // 柱条边线线宽,单位px,默认为1
  96. },
  97. emphasis: {
  98. itemStyle: {
  99. // color: '各异',
  100. barBorderColor: 'rgba(0,0,0,0)', // 柱条边线
  101. barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0
  102. barBorderWidth: 1, // 柱条边线线宽,单位px,默认为1
  103. },
  104. label: {
  105. show: false
  106. // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
  107. // 'inside'|'left'|'right'|'top'|'bottom'
  108. // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
  109. }
  110. }
  111. },
  112. line: {
  113. label: {
  114. show: false
  115. // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
  116. // 'inside'|'left'|'right'|'top'|'bottom'
  117. // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
  118. },
  119. itemStyle: {
  120. // color: 各异,
  121. },
  122. emphasis: {
  123. // color: 各异,
  124. label: {
  125. show: false
  126. // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
  127. // 'inside'|'left'|'right'|'top'|'bottom'
  128. // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
  129. }
  130. },
  131. lineStyle: {
  132. width: 2,
  133. type: 'solid',
  134. shadowColor: 'rgba(0,0,0,0)', //默认透明
  135. shadowBlur: 5,
  136. shadowOffsetX: 3,
  137. shadowOffsetY: 3
  138. },
  139. //smooth : false,
  140. //symbol: null, // 拐点图形类型
  141. symbolSize: 2, // 拐点图形大小
  142. //symbolRotate : null, // 拐点图形旋转控制
  143. showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略)
  144. },
  145. candlestick: {
  146. itemStyle: {
  147. color: '#fe9778',
  148. color0: '#e7dac9'
  149. },
  150. lineStyle: {
  151. width: 1,
  152. color: '#f78766',
  153. color0: '#f1ccb8'
  154. },
  155. areaStyle: {
  156. color: '#e7dac9',
  157. color0: '#c8e49c'
  158. }
  159. },
  160. // 饼图默认参数
  161. pie: {
  162. center: ['50%', '50%'], // 默认全局居中
  163. radius: [0, '75%'],
  164. clockWise: false, // 默认逆时针
  165. startAngle: 90,
  166. minAngle: 0, // 最小角度改为0
  167. selectedOffset: 10, // 选中是扇区偏移量
  168. label: {
  169. show: true,
  170. position: 'outer',
  171. color: '#1b1b1b',
  172. lineStyle: { color: '#1b1b1b' }
  173. // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
  174. },
  175. itemStyle: {
  176. // color: 各异,
  177. borderColor: '#fff',
  178. borderWidth: 1
  179. },
  180. labelLine: {
  181. show: true,
  182. length: 20,
  183. lineStyle: {
  184. // color: 各异,
  185. width: 1,
  186. type: 'solid'
  187. }
  188. }
  189. },
  190. map: {
  191. itemStyle: {
  192. color: '#ddd',
  193. borderColor: '#fff',
  194. borderWidth: 1
  195. },
  196. areaStyle: {
  197. color: '#f3f39d'
  198. },
  199. label: {
  200. show: false,
  201. color: 'rgba(139,69,19,1)'
  202. },
  203. showLegendSymbol: true
  204. },
  205. graph: {
  206. itemStyle: {
  207. color: '#d87a80'
  208. },
  209. linkStyle: {
  210. strokeColor: '#a17e6e'
  211. },
  212. nodeStyle: {
  213. brushType: 'both',
  214. strokeColor: '#a17e6e'
  215. },
  216. label: {
  217. show: false
  218. }
  219. },
  220. gauge: {
  221. axisLine: {
  222. lineStyle: {
  223. color: [
  224. [0.2, '#ed9678'],
  225. [0.8, '#e7dac9'],
  226. [1, '#cb8e85']
  227. ],
  228. width: 8
  229. }
  230. }
  231. }
  232. };
  233. echarts.registerTheme('macarons2', theme);
  234. });