macarons2.js 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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'));
  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. itemStyle: {
  86. normal: {
  87. // color: '各异',
  88. barBorderColor: '#fff', // 柱条边线
  89. barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0
  90. barBorderWidth: 1, // 柱条边线线宽,单位px,默认为1
  91. label: {
  92. show: false
  93. // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
  94. // 'inside'|'left'|'right'|'top'|'bottom'
  95. // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
  96. }
  97. },
  98. emphasis: {
  99. // color: '各异',
  100. barBorderColor: 'rgba(0,0,0,0)', // 柱条边线
  101. barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0
  102. barBorderWidth: 1, // 柱条边线线宽,单位px,默认为1
  103. label: {
  104. show: false
  105. // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
  106. // 'inside'|'left'|'right'|'top'|'bottom'
  107. // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
  108. }
  109. }
  110. }
  111. },
  112. line: {
  113. itemStyle: {
  114. normal: {
  115. // color: 各异,
  116. label: {
  117. show: false
  118. // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
  119. // 'inside'|'left'|'right'|'top'|'bottom'
  120. // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
  121. },
  122. lineStyle: {
  123. width: 2,
  124. type: 'solid',
  125. shadowColor: 'rgba(0,0,0,0)', //默认透明
  126. shadowBlur: 5,
  127. shadowOffsetX: 3,
  128. shadowOffsetY: 3
  129. }
  130. },
  131. emphasis: {
  132. // color: 各异,
  133. label: {
  134. show: false
  135. // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
  136. // 'inside'|'left'|'right'|'top'|'bottom'
  137. // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
  138. }
  139. }
  140. },
  141. //smooth : false,
  142. //symbol: null, // 拐点图形类型
  143. symbolSize: 2, // 拐点图形大小
  144. //symbolRotate : null, // 拐点图形旋转控制
  145. showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略)
  146. },
  147. candlestick: {
  148. itemStyle: {
  149. color: '#fe9778',
  150. color0: '#e7dac9'
  151. },
  152. lineStyle: {
  153. width: 1,
  154. color: '#f78766',
  155. color0: '#f1ccb8'
  156. },
  157. areaStyle: {
  158. color: '#e7dac9',
  159. color0: '#c8e49c'
  160. }
  161. },
  162. // 饼图默认参数
  163. pie: {
  164. center: ['50%', '50%'], // 默认全局居中
  165. radius: [0, '75%'],
  166. clockWise: false, // 默认逆时针
  167. startAngle: 90,
  168. minAngle: 0, // 最小角度改为0
  169. selectedOffset: 10, // 选中是扇区偏移量
  170. itemStyle: {
  171. normal: {
  172. // color: 各异,
  173. borderColor: '#fff',
  174. borderWidth: 1,
  175. label: {
  176. show: true,
  177. position: 'outer',
  178. textStyle: { color: '#1b1b1b' },
  179. lineStyle: { color: '#1b1b1b' }
  180. // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
  181. },
  182. labelLine: {
  183. show: true,
  184. length: 20,
  185. lineStyle: {
  186. // color: 各异,
  187. width: 1,
  188. type: 'solid'
  189. }
  190. }
  191. }
  192. }
  193. },
  194. map: {
  195. itemStyle: {
  196. color: '#ddd',
  197. borderColor: '#fff',
  198. borderWidth: 1
  199. },
  200. areaStyle: {
  201. color: '#f3f39d'
  202. },
  203. label: {
  204. show: false,
  205. color: 'rgba(139,69,19,1)'
  206. },
  207. showLegendSymbol: true
  208. },
  209. graph: {
  210. itemStyle: {
  211. color: '#d87a80'
  212. },
  213. linkStyle: {
  214. strokeColor: '#a17e6e'
  215. },
  216. nodeStyle: {
  217. brushType: 'both',
  218. strokeColor: '#a17e6e'
  219. },
  220. label: {
  221. show: false
  222. }
  223. },
  224. gauge: {
  225. axisLine: {
  226. lineStyle: {
  227. color: [
  228. [0.2, '#ed9678'],
  229. [0.8, '#e7dac9'],
  230. [1, '#cb8e85']
  231. ],
  232. width: 8
  233. }
  234. }
  235. }
  236. };
  237. echarts.registerTheme('macarons2', theme);
  238. });