echarts.html 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('百度ECharts')" />
  5. </head>
  6. <body class="gray-bg">
  7. <div class="row border-bottom white-bg dashboard-header">
  8. <div class="col-sm-12">
  9. <p>ECharts开源来自百度商业前端数据可视化团队,基于html5 Canvas,是一个纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据可视化图表。创新的拖拽重计算、数据视图、值域漫游等特性大大增强了用户体验,赋予了用户对数据进行挖掘、整合的能力。 <a href="http://echarts.baidu.com/doc/about.html" target="_blank">了解更多</a>
  10. </p>
  11. <p>ECharts官网:<a href="http://echarts.baidu.com/" target="_blank">http://echarts.baidu.com/</a>
  12. </p>
  13. </div>
  14. </div>
  15. <div class="wrapper wrapper-content animated fadeInRight">
  16. <div class="row">
  17. <div class="col-sm-6">
  18. <div class="ibox float-e-margins">
  19. <div class="ibox-title">
  20. <h5>折线图</h5>
  21. <div class="ibox-tools">
  22. <a class="collapse-link">
  23. <i class="fa fa-chevron-up"></i>
  24. </a>
  25. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  26. <i class="fa fa-wrench"></i>
  27. </a>
  28. <ul class="dropdown-menu dropdown-user">
  29. <li><a href="#">选项1</a>
  30. </li>
  31. <li><a href="#">选项2</a>
  32. </li>
  33. </ul>
  34. <a class="close-link">
  35. <i class="fa fa-times"></i>
  36. </a>
  37. </div>
  38. </div>
  39. <div class="ibox-content">
  40. <div class="echarts" id="echarts-line-chart"></div>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="col-sm-6">
  45. <div class="ibox float-e-margins">
  46. <div class="ibox-title">
  47. <h5>柱状图</h5>
  48. <div class="ibox-tools">
  49. <a class="collapse-link">
  50. <i class="fa fa-chevron-up"></i>
  51. </a>
  52. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  53. <i class="fa fa-wrench"></i>
  54. </a>
  55. <ul class="dropdown-menu dropdown-user">
  56. <li><a href="#">选项1</a>
  57. </li>
  58. <li><a href="#">选项2</a>
  59. </li>
  60. </ul>
  61. <a class="close-link">
  62. <i class="fa fa-times"></i>
  63. </a>
  64. </div>
  65. </div>
  66. <div class="ibox-content">
  67. <div class="echarts" id="echarts-bar-chart"></div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="row">
  73. <div class="col-sm-6">
  74. <div class="ibox float-e-margins">
  75. <div class="ibox-title">
  76. <h5>散点图</h5>
  77. <div class="ibox-tools">
  78. <a class="collapse-link">
  79. <i class="fa fa-chevron-up"></i>
  80. </a>
  81. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  82. <i class="fa fa-wrench"></i>
  83. </a>
  84. <ul class="dropdown-menu dropdown-user">
  85. <li><a href="#">选项1</a>
  86. </li>
  87. <li><a href="#">选项2</a>
  88. </li>
  89. </ul>
  90. <a class="close-link">
  91. <i class="fa fa-times"></i>
  92. </a>
  93. </div>
  94. </div>
  95. <div class="ibox-content">
  96. <div class="echarts" id="echarts-scatter-chart"></div>
  97. </div>
  98. </div>
  99. </div>
  100. <div class="col-sm-6">
  101. <div class="ibox float-e-margins">
  102. <div class="ibox-title">
  103. <h5>K线图</h5>
  104. <div class="ibox-tools">
  105. <a class="collapse-link">
  106. <i class="fa fa-chevron-up"></i>
  107. </a>
  108. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  109. <i class="fa fa-wrench"></i>
  110. </a>
  111. <ul class="dropdown-menu dropdown-user">
  112. <li><a href="#">选项1</a>
  113. </li>
  114. <li><a href="#">选项2</a>
  115. </li>
  116. </ul>
  117. <a class="close-link">
  118. <i class="fa fa-times"></i>
  119. </a>
  120. </div>
  121. </div>
  122. <div class="ibox-content">
  123. <div class="echarts" id="echarts-k-chart"></div>
  124. </div>
  125. </div>
  126. </div>
  127. <div class="col-sm-6">
  128. <div class="ibox float-e-margins">
  129. <div class="ibox-title">
  130. <h5>饼状图</h5>
  131. <div class="ibox-tools">
  132. <a class="collapse-link">
  133. <i class="fa fa-chevron-up"></i>
  134. </a>
  135. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  136. <i class="fa fa-wrench"></i>
  137. </a>
  138. <ul class="dropdown-menu dropdown-user">
  139. <li><a href="#">选项1</a>
  140. </li>
  141. <li><a href="#">选项2</a>
  142. </li>
  143. </ul>
  144. <a class="close-link">
  145. <i class="fa fa-times"></i>
  146. </a>
  147. </div>
  148. </div>
  149. <div class="ibox-content">
  150. <div class="echarts" id="echarts-pie-chart"></div>
  151. </div>
  152. </div>
  153. </div>
  154. <div class="col-sm-6">
  155. <div class="ibox float-e-margins">
  156. <div class="ibox-title">
  157. <h5>雷达图</h5>
  158. <div class="ibox-tools">
  159. <a class="collapse-link">
  160. <i class="fa fa-chevron-up"></i>
  161. </a>
  162. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  163. <i class="fa fa-wrench"></i>
  164. </a>
  165. <ul class="dropdown-menu dropdown-user">
  166. <li><a href="#">选项1</a>
  167. </li>
  168. <li><a href="#">选项2</a>
  169. </li>
  170. </ul>
  171. <a class="close-link">
  172. <i class="fa fa-times"></i>
  173. </a>
  174. </div>
  175. </div>
  176. <div class="ibox-content">
  177. <div class="echarts" id="echarts-radar-chart"></div>
  178. </div>
  179. </div>
  180. </div>
  181. <div class="col-sm-6">
  182. <div class="ibox float-e-margins">
  183. <div class="ibox-title">
  184. <h5>仪表盘</h5>
  185. <div class="ibox-tools">
  186. <a class="collapse-link">
  187. <i class="fa fa-chevron-up"></i>
  188. </a>
  189. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  190. <i class="fa fa-wrench"></i>
  191. </a>
  192. <ul class="dropdown-menu dropdown-user">
  193. <li><a href="#">选项1</a>
  194. </li>
  195. <li><a href="#">选项2</a>
  196. </li>
  197. </ul>
  198. <a class="close-link">
  199. <i class="fa fa-times"></i>
  200. </a>
  201. </div>
  202. </div>
  203. <div class="ibox-content">
  204. <div class="echarts" id="echarts-gauge-chart"></div>
  205. </div>
  206. </div>
  207. </div>
  208. <div class="col-sm-6">
  209. <div class="ibox float-e-margins">
  210. <div class="ibox-title">
  211. <h5>漏斗图</h5>
  212. <div class="ibox-tools">
  213. <a class="collapse-link">
  214. <i class="fa fa-chevron-up"></i>
  215. </a>
  216. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  217. <i class="fa fa-wrench"></i>
  218. </a>
  219. <ul class="dropdown-menu dropdown-user">
  220. <li><a href="#">选项1</a>
  221. </li>
  222. <li><a href="#">选项2</a>
  223. </li>
  224. </ul>
  225. <a class="close-link">
  226. <i class="fa fa-times"></i>
  227. </a>
  228. </div>
  229. </div>
  230. <div class="ibox-content">
  231. <div class="echarts" id="echarts-funnel-chart"></div>
  232. </div>
  233. </div>
  234. </div>
  235. </div>
  236. <div class="row">
  237. <div class="col-sm-12">
  238. <div class="ibox float-e-margins">
  239. <div class="ibox-title">
  240. <h5>中国地图</h5>
  241. <div class="ibox-tools">
  242. <a class="collapse-link">
  243. <i class="fa fa-chevron-up"></i>
  244. </a>
  245. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  246. <i class="fa fa-wrench"></i>
  247. </a>
  248. <ul class="dropdown-menu dropdown-user">
  249. <li><a href="#">选项1</a>
  250. </li>
  251. <li><a href="#">选项2</a>
  252. </li>
  253. </ul>
  254. <a class="close-link">
  255. <i class="fa fa-times"></i>
  256. </a>
  257. </div>
  258. </div>
  259. <div class="ibox-content">
  260. <div style="height:600px" id="echarts-map-chart"></div>
  261. </div>
  262. </div>
  263. </div>
  264. </div>
  265. </div>
  266. <th:block th:include="include :: footer" />
  267. <th:block th:include="include :: echarts-js" />
  268. <script type="text/javascript">
  269. $(function () {
  270. var lineChart = echarts.init(document.getElementById("echarts-line-chart"));
  271. var lineoption = {
  272. title : {
  273. text: '未来一周气温变化'
  274. },
  275. tooltip : {
  276. trigger: 'axis'
  277. },
  278. legend: {
  279. data:['最高气温','最低气温']
  280. },
  281. grid:{
  282. x:40,
  283. x2:40,
  284. y2:24
  285. },
  286. calculable : true,
  287. xAxis : [
  288. {
  289. type : 'category',
  290. boundaryGap : false,
  291. data : ['周一','周二','周三','周四','周五','周六','周日']
  292. }
  293. ],
  294. yAxis : [
  295. {
  296. type : 'value',
  297. axisLabel : {
  298. formatter: '{value} °C'
  299. }
  300. }
  301. ],
  302. series : [
  303. {
  304. name:'最高气温',
  305. type:'line',
  306. data:[11, 11, 15, 13, 12, 13, 10],
  307. markPoint : {
  308. data : [
  309. {type : 'max', name: '最大值'},
  310. {type : 'min', name: '最小值'}
  311. ]
  312. },
  313. markLine : {
  314. data : [
  315. {type : 'average', name: '平均值'}
  316. ]
  317. }
  318. },
  319. {
  320. name:'最低气温',
  321. type:'line',
  322. data:[1, -2, 2, 5, 3, 2, 0],
  323. markPoint : {
  324. data : [
  325. {name : '周最低', value : -2, xAxis: 1, yAxis: -1.5}
  326. ]
  327. },
  328. markLine : {
  329. data : [
  330. {type : 'average', name : '平均值'}
  331. ]
  332. }
  333. }
  334. ]
  335. };
  336. lineChart.setOption(lineoption);
  337. $(window).resize(lineChart.resize);
  338. var barChart = echarts.init(document.getElementById("echarts-bar-chart"));
  339. var baroption = {
  340. title : {
  341. text: '某地区蒸发量和降水量'
  342. },
  343. tooltip : {
  344. trigger: 'axis'
  345. },
  346. legend: {
  347. data:['蒸发量','降水量']
  348. },
  349. grid:{
  350. x:30,
  351. x2:40,
  352. y2:24
  353. },
  354. calculable : true,
  355. xAxis : [
  356. {
  357. type : 'category',
  358. data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
  359. }
  360. ],
  361. yAxis : [
  362. {
  363. type : 'value'
  364. }
  365. ],
  366. series : [
  367. {
  368. name:'蒸发量',
  369. type:'bar',
  370. data:[2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
  371. markPoint : {
  372. data : [
  373. {type : 'max', name: '最大值'},
  374. {type : 'min', name: '最小值'}
  375. ]
  376. },
  377. markLine : {
  378. data : [
  379. {type : 'average', name: '平均值'}
  380. ]
  381. }
  382. },
  383. {
  384. name:'降水量',
  385. type:'bar',
  386. data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
  387. markPoint : {
  388. data : [
  389. {name : '年最高', value : 182.2, xAxis: 7, yAxis: 183, symbolSize:18},
  390. {name : '年最低', value : 2.3, xAxis: 11, yAxis: 3}
  391. ]
  392. },
  393. markLine : {
  394. data : [
  395. {type : 'average', name : '平均值'}
  396. ]
  397. }
  398. }
  399. ]
  400. };
  401. barChart.setOption(baroption);
  402. window.onresize = barChart.resize;
  403. var scatterChart = echarts.init(document.getElementById("echarts-scatter-chart"));
  404. var scatteroption = {
  405. title : {
  406. text: '男性女性身高体重分布',
  407. subtext: '抽样调查来自: Heinz 2003'
  408. },
  409. tooltip : {
  410. trigger: 'axis',
  411. showDelay : 0,
  412. axisPointer:{
  413. type : 'cross',
  414. lineStyle: {
  415. type : 'dashed',
  416. width : 1
  417. }
  418. }
  419. },
  420. legend: {
  421. data:['女性','男性']
  422. },
  423. grid:{
  424. x:45,
  425. x2:40,
  426. y2:24
  427. },
  428. xAxis : [
  429. {
  430. type : 'value',
  431. scale:true,
  432. axisLabel : {
  433. formatter: '{value} cm'
  434. }
  435. }
  436. ],
  437. yAxis : [
  438. {
  439. type : 'value',
  440. scale:true,
  441. axisLabel : {
  442. formatter: '{value} kg'
  443. }
  444. }
  445. ],
  446. series : [
  447. {
  448. name:'女性',
  449. type:'scatter',
  450. tooltip : {
  451. trigger: 'item',
  452. formatter : function (params) {
  453. if (params.value.length > 1) {
  454. return params.seriesName + ' :<br/>'
  455. + params.value[0] + 'cm '
  456. + params.value[1] + 'kg ';
  457. }
  458. else {
  459. return params.seriesName + ' :<br/>'
  460. + params.name + ' : '
  461. + params.value + 'kg ';
  462. }
  463. }
  464. },
  465. data: [
  466. [161.2, 51.6], [167.5, 59.0], [159.5, 49.2], [157.0, 63.0], [155.8, 53.6],
  467. [170.0, 59.0], [159.1, 47.6], [166.0, 69.8], [176.2, 66.8], [160.2, 75.2],
  468. [172.5, 55.2], [170.9, 54.2], [172.9, 62.5], [153.4, 42.0], [160.0, 50.0],
  469. [147.2, 49.8], [168.2, 49.2], [175.0, 73.2], [157.0, 47.8], [167.6, 68.8],
  470. [159.5, 50.6], [175.0, 82.5], [166.8, 57.2], [176.5, 87.8], [170.2, 72.8],
  471. [174.0, 54.5], [173.0, 59.8], [179.9, 67.3], [170.5, 67.8], [160.0, 47.0],
  472. [154.4, 46.2], [162.0, 55.0], [176.5, 83.0], [160.0, 54.4], [152.0, 45.8],
  473. [162.1, 53.6], [170.0, 73.2], [160.2, 52.1], [161.3, 67.9], [166.4, 56.6],
  474. [168.9, 62.3], [163.8, 58.5], [167.6, 54.5], [160.0, 50.2], [161.3, 60.3],
  475. [167.6, 58.3], [165.1, 56.2], [160.0, 50.2], [170.0, 72.9], [157.5, 59.8],
  476. [167.6, 61.0], [160.7, 69.1], [163.2, 55.9], [152.4, 46.5], [157.5, 54.3],
  477. [168.3, 54.8], [180.3, 60.7], [165.5, 60.0], [165.0, 62.0], [164.5, 60.3],
  478. [156.0, 52.7], [160.0, 74.3], [163.0, 62.0], [165.7, 73.1], [161.0, 80.0],
  479. [162.0, 54.7], [166.0, 53.2], [174.0, 75.7], [172.7, 61.1], [167.6, 55.7],
  480. [151.1, 48.7], [164.5, 52.3], [163.5, 50.0], [152.0, 59.3], [169.0, 62.5],
  481. [164.0, 55.7], [161.2, 54.8], [155.0, 45.9], [170.0, 70.6], [176.2, 67.2],
  482. [170.0, 69.4], [162.5, 58.2], [170.3, 64.8], [164.1, 71.6], [169.5, 52.8],
  483. [163.2, 59.8], [154.5, 49.0], [159.8, 50.0], [173.2, 69.2], [170.0, 55.9],
  484. [161.4, 63.4], [169.0, 58.2], [166.2, 58.6], [159.4, 45.7], [162.5, 52.2],
  485. [159.0, 48.6], [162.8, 57.8], [159.0, 55.6], [179.8, 66.8], [162.9, 59.4],
  486. [161.0, 53.6], [151.1, 73.2], [168.2, 53.4], [168.9, 69.0], [173.2, 58.4],
  487. [171.8, 56.2], [178.0, 70.6], [164.3, 59.8], [163.0, 72.0], [168.5, 65.2],
  488. [166.8, 56.6], [172.7, 105.2], [163.5, 51.8], [169.4, 63.4], [167.8, 59.0],
  489. [159.5, 47.6], [167.6, 63.0], [161.2, 55.2], [160.0, 45.0], [163.2, 54.0],
  490. [162.2, 50.2], [161.3, 60.2], [149.5, 44.8], [157.5, 58.8], [163.2, 56.4],
  491. [172.7, 62.0], [155.0, 49.2], [156.5, 67.2], [164.0, 53.8], [160.9, 54.4],
  492. [162.8, 58.0], [167.0, 59.8], [160.0, 54.8], [160.0, 43.2], [168.9, 60.5],
  493. [158.2, 46.4], [156.0, 64.4], [160.0, 48.8], [167.1, 62.2], [158.0, 55.5],
  494. [167.6, 57.8], [156.0, 54.6], [162.1, 59.2], [173.4, 52.7], [159.8, 53.2],
  495. [170.5, 64.5], [159.2, 51.8], [157.5, 56.0], [161.3, 63.6], [162.6, 63.2],
  496. [160.0, 59.5], [168.9, 56.8], [165.1, 64.1], [162.6, 50.0], [165.1, 72.3],
  497. [166.4, 55.0], [160.0, 55.9], [152.4, 60.4], [170.2, 69.1], [162.6, 84.5],
  498. [170.2, 55.9], [158.8, 55.5], [172.7, 69.5], [167.6, 76.4], [162.6, 61.4],
  499. [167.6, 65.9], [156.2, 58.6], [175.2, 66.8], [172.1, 56.6], [162.6, 58.6],
  500. [160.0, 55.9], [165.1, 59.1], [182.9, 81.8], [166.4, 70.7], [165.1, 56.8],
  501. [177.8, 60.0], [165.1, 58.2], [175.3, 72.7], [154.9, 54.1], [158.8, 49.1],
  502. [172.7, 75.9], [168.9, 55.0], [161.3, 57.3], [167.6, 55.0], [165.1, 65.5],
  503. [175.3, 65.5], [157.5, 48.6], [163.8, 58.6], [167.6, 63.6], [165.1, 55.2],
  504. [165.1, 62.7], [168.9, 56.6], [162.6, 53.9], [164.5, 63.2], [176.5, 73.6],
  505. [168.9, 62.0], [175.3, 63.6], [159.4, 53.2], [160.0, 53.4], [170.2, 55.0],
  506. [162.6, 70.5], [167.6, 54.5], [162.6, 54.5], [160.7, 55.9], [160.0, 59.0],
  507. [157.5, 63.6], [162.6, 54.5], [152.4, 47.3], [170.2, 67.7], [165.1, 80.9],
  508. [172.7, 70.5], [165.1, 60.9], [170.2, 63.6], [170.2, 54.5], [170.2, 59.1],
  509. [161.3, 70.5], [167.6, 52.7], [167.6, 62.7], [165.1, 86.3], [162.6, 66.4],
  510. [152.4, 67.3], [168.9, 63.0], [170.2, 73.6], [175.2, 62.3], [175.2, 57.7],
  511. [160.0, 55.4], [165.1, 104.1], [174.0, 55.5], [170.2, 77.3], [160.0, 80.5],
  512. [167.6, 64.5], [167.6, 72.3], [167.6, 61.4], [154.9, 58.2], [162.6, 81.8],
  513. [175.3, 63.6], [171.4, 53.4], [157.5, 54.5], [165.1, 53.6], [160.0, 60.0],
  514. [174.0, 73.6], [162.6, 61.4], [174.0, 55.5], [162.6, 63.6], [161.3, 60.9],
  515. [156.2, 60.0], [149.9, 46.8], [169.5, 57.3], [160.0, 64.1], [175.3, 63.6],
  516. [169.5, 67.3], [160.0, 75.5], [172.7, 68.2], [162.6, 61.4], [157.5, 76.8],
  517. [176.5, 71.8], [164.4, 55.5], [160.7, 48.6], [174.0, 66.4], [163.8, 67.3]
  518. ],
  519. markPoint : {
  520. data : [
  521. {type : 'max', name: '最大值'},
  522. {type : 'min', name: '最小值'}
  523. ]
  524. },
  525. markLine : {
  526. data : [
  527. {type : 'average', name: '平均值'}
  528. ]
  529. }
  530. },
  531. {
  532. name:'男性',
  533. type:'scatter',
  534. tooltip : {
  535. trigger: 'item',
  536. formatter : function (params) {
  537. if (params.value.length > 1) {
  538. return params.seriesName + ' :<br/>'
  539. + params.value[0] + 'cm '
  540. + params.value[1] + 'kg ';
  541. }
  542. else {
  543. return params.seriesName + ' :<br/>'
  544. + params.name + ' : '
  545. + params.value + 'kg ';
  546. }
  547. }
  548. },
  549. data: [
  550. [174.0, 65.6], [175.3, 71.8], [193.5, 80.7], [186.5, 72.6], [187.2, 78.8],
  551. [181.5, 74.8], [184.0, 86.4], [184.5, 78.4], [175.0, 62.0], [184.0, 81.6],
  552. [180.0, 76.6], [177.8, 83.6], [192.0, 90.0], [176.0, 74.6], [174.0, 71.0],
  553. [184.0, 79.6], [192.7, 93.8], [171.5, 70.0], [173.0, 72.4], [176.0, 85.9],
  554. [176.0, 78.8], [180.5, 77.8], [172.7, 66.2], [176.0, 86.4], [173.5, 81.8],
  555. [178.0, 89.6], [180.3, 82.8], [180.3, 76.4], [164.5, 63.2], [173.0, 60.9],
  556. [183.5, 74.8], [175.5, 70.0], [188.0, 72.4], [189.2, 84.1], [172.8, 69.1],
  557. [170.0, 59.5], [182.0, 67.2], [170.0, 61.3], [177.8, 68.6], [184.2, 80.1],
  558. [186.7, 87.8], [171.4, 84.7], [172.7, 73.4], [175.3, 72.1], [180.3, 82.6],
  559. [182.9, 88.7], [188.0, 84.1], [177.2, 94.1], [172.1, 74.9], [167.0, 59.1],
  560. [169.5, 75.6], [174.0, 86.2], [172.7, 75.3], [182.2, 87.1], [164.1, 55.2],
  561. [163.0, 57.0], [171.5, 61.4], [184.2, 76.8], [174.0, 86.8], [174.0, 72.2],
  562. [177.0, 71.6], [186.0, 84.8], [167.0, 68.2], [171.8, 66.1], [182.0, 72.0],
  563. [167.0, 64.6], [177.8, 74.8], [164.5, 70.0], [192.0, 101.6], [175.5, 63.2],
  564. [171.2, 79.1], [181.6, 78.9], [167.4, 67.7], [181.1, 66.0], [177.0, 68.2],
  565. [174.5, 63.9], [177.5, 72.0], [170.5, 56.8], [182.4, 74.5], [197.1, 90.9],
  566. [180.1, 93.0], [175.5, 80.9], [180.6, 72.7], [184.4, 68.0], [175.5, 70.9],
  567. [180.6, 72.5], [177.0, 72.5], [177.1, 83.4], [181.6, 75.5], [176.5, 73.0],
  568. [175.0, 70.2], [174.0, 73.4], [165.1, 70.5], [177.0, 68.9], [192.0, 102.3],
  569. [176.5, 68.4], [169.4, 65.9], [182.1, 75.7], [179.8, 84.5], [175.3, 87.7],
  570. [184.9, 86.4], [177.3, 73.2], [167.4, 53.9], [178.1, 72.0], [168.9, 55.5],
  571. [157.2, 58.4], [180.3, 83.2], [170.2, 72.7], [177.8, 64.1], [172.7, 72.3],
  572. [165.1, 65.0], [186.7, 86.4], [165.1, 65.0], [174.0, 88.6], [175.3, 84.1],
  573. [185.4, 66.8], [177.8, 75.5], [180.3, 93.2], [180.3, 82.7], [177.8, 58.0],
  574. [177.8, 79.5], [177.8, 78.6], [177.8, 71.8], [177.8, 116.4], [163.8, 72.2],
  575. [188.0, 83.6], [198.1, 85.5], [175.3, 90.9], [166.4, 85.9], [190.5, 89.1],
  576. [166.4, 75.0], [177.8, 77.7], [179.7, 86.4], [172.7, 90.9], [190.5, 73.6],
  577. [185.4, 76.4], [168.9, 69.1], [167.6, 84.5], [175.3, 64.5], [170.2, 69.1],
  578. [190.5, 108.6], [177.8, 86.4], [190.5, 80.9], [177.8, 87.7], [184.2, 94.5],
  579. [176.5, 80.2], [177.8, 72.0], [180.3, 71.4], [171.4, 72.7], [172.7, 84.1],
  580. [172.7, 76.8], [177.8, 63.6], [177.8, 80.9], [182.9, 80.9], [170.2, 85.5],
  581. [167.6, 68.6], [175.3, 67.7], [165.1, 66.4], [185.4, 102.3], [181.6, 70.5],
  582. [172.7, 95.9], [190.5, 84.1], [179.1, 87.3], [175.3, 71.8], [170.2, 65.9],
  583. [193.0, 95.9], [171.4, 91.4], [177.8, 81.8], [177.8, 96.8], [167.6, 69.1],
  584. [167.6, 82.7], [180.3, 75.5], [182.9, 79.5], [176.5, 73.6], [186.7, 91.8],
  585. [188.0, 84.1], [188.0, 85.9], [177.8, 81.8], [174.0, 82.5], [177.8, 80.5],
  586. [171.4, 70.0], [185.4, 81.8], [185.4, 84.1], [188.0, 90.5], [188.0, 91.4],
  587. [182.9, 89.1], [176.5, 85.0], [175.3, 69.1], [175.3, 73.6], [188.0, 80.5],
  588. [188.0, 82.7], [175.3, 86.4], [170.5, 67.7], [179.1, 92.7], [177.8, 93.6],
  589. [175.3, 70.9], [182.9, 75.0], [170.8, 93.2], [188.0, 93.2], [180.3, 77.7],
  590. [177.8, 61.4], [185.4, 94.1], [168.9, 75.0], [185.4, 83.6], [180.3, 85.5],
  591. [174.0, 73.9], [167.6, 66.8], [182.9, 87.3], [160.0, 72.3], [180.3, 88.6],
  592. [167.6, 75.5], [186.7, 101.4], [175.3, 91.1], [175.3, 67.3], [175.9, 77.7],
  593. [175.3, 81.8], [179.1, 75.5], [181.6, 84.5], [177.8, 76.6], [182.9, 85.0],
  594. [177.8, 102.5], [184.2, 77.3], [179.1, 71.8], [176.5, 87.9], [188.0, 94.3],
  595. [174.0, 70.9], [167.6, 64.5], [170.2, 77.3], [167.6, 72.3], [188.0, 87.3],
  596. [174.0, 80.0], [176.5, 82.3], [180.3, 73.6], [167.6, 74.1], [188.0, 85.9],
  597. [180.3, 73.2], [167.6, 76.3], [183.0, 65.9], [183.0, 90.9], [179.1, 89.1],
  598. [170.2, 62.3], [177.8, 82.7], [179.1, 79.1], [190.5, 98.2], [177.8, 84.1],
  599. [180.3, 83.2], [180.3, 83.2]
  600. ],
  601. markPoint : {
  602. data : [
  603. {type : 'max', name: '最大值'},
  604. {type : 'min', name: '最小值'}
  605. ]
  606. },
  607. markLine : {
  608. data : [
  609. {type : 'average', name: '平均值'}
  610. ]
  611. }
  612. }
  613. ]
  614. };
  615. scatterChart.setOption(scatteroption);
  616. $(window).resize(scatterChart.resize);
  617. var kChart = echarts.init(document.getElementById("echarts-k-chart"));
  618. var koption = {
  619. title : {
  620. text: '2013年上半年上证指数'
  621. },
  622. tooltip : {
  623. trigger: 'axis',
  624. formatter: function (params) {
  625. var res = params[0].seriesName + ' ' + params[0].name;
  626. res += '<br/> 开盘 : ' + params[0].value[0] + ' 最高 : ' + params[0].value[3];
  627. res += '<br/> 收盘 : ' + params[0].value[1] + ' 最低 : ' + params[0].value[2];
  628. return res;
  629. }
  630. },
  631. legend: {
  632. data:['上证指数']
  633. },
  634. grid:{
  635. x:40,
  636. x2:2
  637. },
  638. dataZoom : {
  639. show : true,
  640. realtime: true,
  641. start : 50,
  642. end : 100
  643. },
  644. xAxis : [
  645. {
  646. type : 'category',
  647. boundaryGap : true,
  648. axisTick: {onGap:false},
  649. splitLine: {show:false},
  650. data : [
  651. "2013/1/24", "2013/1/25", "2013/1/28", "2013/1/29", "2013/1/30",
  652. "2013/1/31", "2013/2/1", "2013/2/4", "2013/2/5", "2013/2/6",
  653. "2013/2/7", "2013/2/8", "2013/2/18", "2013/2/19", "2013/2/20",
  654. "2013/2/21", "2013/2/22", "2013/2/25", "2013/2/26", "2013/2/27",
  655. "2013/2/28", "2013/3/1", "2013/3/4", "2013/3/5", "2013/3/6",
  656. "2013/3/7", "2013/3/8", "2013/3/11", "2013/3/12", "2013/3/13",
  657. "2013/3/14", "2013/3/15", "2013/3/18", "2013/3/19", "2013/3/20",
  658. "2013/3/21", "2013/3/22", "2013/3/25", "2013/3/26", "2013/3/27",
  659. "2013/3/28", "2013/3/29", "2013/4/1", "2013/4/2", "2013/4/3",
  660. "2013/4/8", "2013/4/9", "2013/4/10", "2013/4/11", "2013/4/12",
  661. "2013/4/15", "2013/4/16", "2013/4/17", "2013/4/18", "2013/4/19",
  662. "2013/4/22", "2013/4/23", "2013/4/24", "2013/4/25", "2013/4/26",
  663. "2013/5/2", "2013/5/3", "2013/5/6", "2013/5/7", "2013/5/8",
  664. "2013/5/9", "2013/5/10", "2013/5/13", "2013/5/14", "2013/5/15",
  665. "2013/5/16", "2013/5/17", "2013/5/20", "2013/5/21", "2013/5/22",
  666. "2013/5/23", "2013/5/24", "2013/5/27", "2013/5/28", "2013/5/29",
  667. "2013/5/30", "2013/5/31", "2013/6/3", "2013/6/4", "2013/6/5",
  668. "2013/6/6", "2013/6/7", "2013/6/13"
  669. ]
  670. }
  671. ],
  672. yAxis : [
  673. {
  674. type : 'value',
  675. scale:true,
  676. boundaryGap: [0.01, 0.01]
  677. }
  678. ],
  679. series : [
  680. {
  681. name:'上证指数',
  682. type:'k',
  683. data:[ // 开盘,收盘,最低,最高
  684. [2320.26,2302.6,2287.3,2362.94],
  685. [2300,2291.3,2288.26,2308.38],
  686. [2295.35,2346.5,2295.35,2346.92],
  687. [2347.22,2358.98,2337.35,2363.8],
  688. [2360.75,2382.48,2347.89,2383.76],
  689. [2383.43,2385.42,2371.23,2391.82],
  690. [2377.41,2419.02,2369.57,2421.15],
  691. [2425.92,2428.15,2417.58,2440.38],
  692. [2411,2433.13,2403.3,2437.42],
  693. [2432.68,2434.48,2427.7,2441.73],
  694. [2430.69,2418.53,2394.22,2433.89],
  695. [2416.62,2432.4,2414.4,2443.03],
  696. [2441.91,2421.56,2415.43,2444.8],
  697. [2420.26,2382.91,2373.53,2427.07],
  698. [2383.49,2397.18,2370.61,2397.94],
  699. [2378.82,2325.95,2309.17,2378.82],
  700. [2322.94,2314.16,2308.76,2330.88],
  701. [2320.62,2325.82,2315.01,2338.78],
  702. [2313.74,2293.34,2289.89,2340.71],
  703. [2297.77,2313.22,2292.03,2324.63],
  704. [2322.32,2365.59,2308.92,2366.16],
  705. [2364.54,2359.51,2330.86,2369.65],
  706. [2332.08,2273.4,2259.25,2333.54],
  707. [2274.81,2326.31,2270.1,2328.14],
  708. [2333.61,2347.18,2321.6,2351.44],
  709. [2340.44,2324.29,2304.27,2352.02],
  710. [2326.42,2318.61,2314.59,2333.67],
  711. [2314.68,2310.59,2296.58,2320.96],
  712. [2309.16,2286.6,2264.83,2333.29],
  713. [2282.17,2263.97,2253.25,2286.33],
  714. [2255.77,2270.28,2253.31,2276.22],
  715. [2269.31,2278.4,2250,2312.08],
  716. [2267.29,2240.02,2239.21,2276.05],
  717. [2244.26,2257.43,2232.02,2261.31],
  718. [2257.74,2317.37,2257.42,2317.86],
  719. [2318.21,2324.24,2311.6,2330.81],
  720. [2321.4,2328.28,2314.97,2332],
  721. [2334.74,2326.72,2319.91,2344.89],
  722. [2318.58,2297.67,2281.12,2319.99],
  723. [2299.38,2301.26,2289,2323.48],
  724. [2273.55,2236.3,2232.91,2273.55],
  725. [2238.49,2236.62,2228.81,2246.87],
  726. [2229.46,2234.4,2227.31,2243.95],
  727. [2234.9,2227.74,2220.44,2253.42],
  728. [2232.69,2225.29,2217.25,2241.34],
  729. [2196.24,2211.59,2180.67,2212.59],
  730. [2215.47,2225.77,2215.47,2234.73],
  731. [2224.93,2226.13,2212.56,2233.04],
  732. [2236.98,2219.55,2217.26,2242.48],
  733. [2218.09,2206.78,2204.44,2226.26],
  734. [2199.91,2181.94,2177.39,2204.99],
  735. [2169.63,2194.85,2165.78,2196.43],
  736. [2195.03,2193.8,2178.47,2197.51],
  737. [2181.82,2197.6,2175.44,2206.03],
  738. [2201.12,2244.64,2200.58,2250.11],
  739. [2236.4,2242.17,2232.26,2245.12],
  740. [2242.62,2184.54,2182.81,2242.62],
  741. [2187.35,2218.32,2184.11,2226.12],
  742. [2213.19,2199.31,2191.85,2224.63],
  743. [2203.89,2177.91,2173.86,2210.58],
  744. [2170.78,2174.12,2161.14,2179.65],
  745. [2179.05,2205.5,2179.05,2222.81],
  746. [2212.5,2231.17,2212.5,2236.07],
  747. [2227.86,2235.57,2219.44,2240.26],
  748. [2242.39,2246.3,2235.42,2255.21],
  749. [2246.96,2232.97,2221.38,2247.86],
  750. [2228.82,2246.83,2225.81,2247.67],
  751. [2247.68,2241.92,2231.36,2250.85],
  752. [2238.9,2217.01,2205.87,2239.93],
  753. [2217.09,2224.8,2213.58,2225.19],
  754. [2221.34,2251.81,2210.77,2252.87],
  755. [2249.81,2282.87,2248.41,2288.09],
  756. [2286.33,2299.99,2281.9,2309.39],
  757. [2297.11,2305.11,2290.12,2305.3],
  758. [2303.75,2302.4,2292.43,2314.18],
  759. [2293.81,2275.67,2274.1,2304.95],
  760. [2281.45,2288.53,2270.25,2292.59],
  761. [2286.66,2293.08,2283.94,2301.7],
  762. [2293.4,2321.32,2281.47,2322.1],
  763. [2323.54,2324.02,2321.17,2334.33],
  764. [2316.25,2317.75,2310.49,2325.72],
  765. [2320.74,2300.59,2299.37,2325.53],
  766. [2300.21,2299.25,2294.11,2313.43],
  767. [2297.1,2272.42,2264.76,2297.1],
  768. [2270.71,2270.93,2260.87,2276.86],
  769. [2264.43,2242.11,2240.07,2266.69],
  770. [2242.26,2210.9,2205.07,2250.63],
  771. [2190.1,2148.35,2126.22,2190.1]
  772. ]
  773. }
  774. ]
  775. };
  776. kChart.setOption(koption);
  777. $(window).resize(kChart.resize);
  778. var pieChart = echarts.init(document.getElementById("echarts-pie-chart"));
  779. var pieoption = {
  780. title : {
  781. text: '某站点用户访问来源',
  782. subtext: '纯属虚构',
  783. x:'center'
  784. },
  785. tooltip : {
  786. trigger: 'item',
  787. formatter: "{a} <br/>{b} : {c} ({d}%)"
  788. },
  789. legend: {
  790. orient : 'vertical',
  791. x : 'left',
  792. data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
  793. },
  794. calculable : true,
  795. series : [
  796. {
  797. name:'访问来源',
  798. type:'pie',
  799. radius : '55%',
  800. center: ['50%', '60%'],
  801. data:[
  802. {value:335, name:'直接访问'},
  803. {value:310, name:'邮件营销'},
  804. {value:234, name:'联盟广告'},
  805. {value:135, name:'视频广告'},
  806. {value:1548, name:'搜索引擎'}
  807. ]
  808. }
  809. ]
  810. };
  811. pieChart.setOption(pieoption);
  812. $(window).resize(pieChart.resize);
  813. var radarChart = echarts.init(document.getElementById("echarts-radar-chart"));
  814. var radaroption = {
  815. title : {
  816. text: '预算 vs 开销',
  817. subtext: '纯属虚构'
  818. },
  819. tooltip : {
  820. trigger: 'axis'
  821. },
  822. legend: {
  823. orient : 'vertical',
  824. x : 'right',
  825. y : 'bottom',
  826. data:['预算分配','实际开销']
  827. },
  828. polar : [
  829. {
  830. indicator : [
  831. { text: '销售', max: 6000},
  832. { text: '管理', max: 16000},
  833. { text: '信息技术', max: 30000},
  834. { text: '客服', max: 38000},
  835. { text: '研发', max: 52000},
  836. { text: '市场', max: 25000}
  837. ]
  838. }
  839. ],
  840. calculable : true,
  841. series : [
  842. {
  843. name: '预算 vs 开销',
  844. type: 'radar',
  845. data : [
  846. {
  847. value : [4300, 10000, 28000, 35000, 50000, 19000],
  848. name : '预算分配'
  849. },
  850. {
  851. value : [5000, 14000, 28000, 31000, 42000, 21000],
  852. name : '实际开销'
  853. }
  854. ]
  855. }
  856. ]
  857. };
  858. radarChart.setOption(radaroption);
  859. $(window).resize(radarChart.resize);
  860. var mapChart = echarts.init(document.getElementById("echarts-map-chart"));
  861. var mapoption = {
  862. title : {
  863. text: 'iphone销量',
  864. subtext: '纯属虚构',
  865. x:'center'
  866. },
  867. tooltip : {
  868. trigger: 'item'
  869. },
  870. legend: {
  871. orient: 'vertical',
  872. x:'left',
  873. data:['iphone3','iphone4','iphone5']
  874. },
  875. dataRange: {
  876. min: 0,
  877. max: 2500,
  878. x: 'left',
  879. y: 'bottom',
  880. text:['高','低'], // 文本,默认为数值文本
  881. calculable : true
  882. },
  883. toolbox: {
  884. show: true,
  885. orient : 'vertical',
  886. x: 'right',
  887. y: 'center',
  888. feature : {
  889. mark : {show: true},
  890. dataView : {show: true, readOnly: false},
  891. restore : {show: true},
  892. saveAsImage : {show: true}
  893. }
  894. },
  895. roamController: {
  896. show: true,
  897. x: 'right',
  898. mapTypeControl: {
  899. 'china': true
  900. }
  901. },
  902. series : [
  903. {
  904. name: 'iphone3',
  905. type: 'map',
  906. mapType: 'china',
  907. roam: false,
  908. itemStyle:{
  909. normal:{label:{show:true}},
  910. emphasis:{label:{show:true}}
  911. },
  912. data:[
  913. {name: '北京',value: Math.round(Math.random()*1000)},
  914. {name: '天津',value: Math.round(Math.random()*1000)},
  915. {name: '上海',value: Math.round(Math.random()*1000)},
  916. {name: '重庆',value: Math.round(Math.random()*1000)},
  917. {name: '河北',value: Math.round(Math.random()*1000)},
  918. {name: '河南',value: Math.round(Math.random()*1000)},
  919. {name: '云南',value: Math.round(Math.random()*1000)},
  920. {name: '辽宁',value: Math.round(Math.random()*1000)},
  921. {name: '黑龙江',value: Math.round(Math.random()*1000)},
  922. {name: '湖南',value: Math.round(Math.random()*1000)},
  923. {name: '安徽',value: Math.round(Math.random()*1000)},
  924. {name: '山东',value: Math.round(Math.random()*1000)},
  925. {name: '新疆',value: Math.round(Math.random()*1000)},
  926. {name: '江苏',value: Math.round(Math.random()*1000)},
  927. {name: '浙江',value: Math.round(Math.random()*1000)},
  928. {name: '江西',value: Math.round(Math.random()*1000)},
  929. {name: '湖北',value: Math.round(Math.random()*1000)},
  930. {name: '广西',value: Math.round(Math.random()*1000)},
  931. {name: '甘肃',value: Math.round(Math.random()*1000)},
  932. {name: '山西',value: Math.round(Math.random()*1000)},
  933. {name: '内蒙古',value: Math.round(Math.random()*1000)},
  934. {name: '陕西',value: Math.round(Math.random()*1000)},
  935. {name: '吉林',value: Math.round(Math.random()*1000)},
  936. {name: '福建',value: Math.round(Math.random()*1000)},
  937. {name: '贵州',value: Math.round(Math.random()*1000)},
  938. {name: '广东',value: Math.round(Math.random()*1000)},
  939. {name: '青海',value: Math.round(Math.random()*1000)},
  940. {name: '西藏',value: Math.round(Math.random()*1000)},
  941. {name: '四川',value: Math.round(Math.random()*1000)},
  942. {name: '宁夏',value: Math.round(Math.random()*1000)},
  943. {name: '海南',value: Math.round(Math.random()*1000)},
  944. {name: '台湾',value: Math.round(Math.random()*1000)},
  945. {name: '香港',value: Math.round(Math.random()*1000)},
  946. {name: '澳门',value: Math.round(Math.random()*1000)}
  947. ]
  948. },
  949. {
  950. name: 'iphone4',
  951. type: 'map',
  952. mapType: 'china',
  953. itemStyle:{
  954. normal:{label:{show:true}},
  955. emphasis:{label:{show:true}}
  956. },
  957. data:[
  958. {name: '北京',value: Math.round(Math.random()*1000)},
  959. {name: '天津',value: Math.round(Math.random()*1000)},
  960. {name: '上海',value: Math.round(Math.random()*1000)},
  961. {name: '重庆',value: Math.round(Math.random()*1000)},
  962. {name: '河北',value: Math.round(Math.random()*1000)},
  963. {name: '安徽',value: Math.round(Math.random()*1000)},
  964. {name: '新疆',value: Math.round(Math.random()*1000)},
  965. {name: '浙江',value: Math.round(Math.random()*1000)},
  966. {name: '江西',value: Math.round(Math.random()*1000)},
  967. {name: '山西',value: Math.round(Math.random()*1000)},
  968. {name: '内蒙古',value: Math.round(Math.random()*1000)},
  969. {name: '吉林',value: Math.round(Math.random()*1000)},
  970. {name: '福建',value: Math.round(Math.random()*1000)},
  971. {name: '广东',value: Math.round(Math.random()*1000)},
  972. {name: '西藏',value: Math.round(Math.random()*1000)},
  973. {name: '四川',value: Math.round(Math.random()*1000)},
  974. {name: '宁夏',value: Math.round(Math.random()*1000)},
  975. {name: '香港',value: Math.round(Math.random()*1000)},
  976. {name: '澳门',value: Math.round(Math.random()*1000)}
  977. ]
  978. },
  979. {
  980. name: 'iphone5',
  981. type: 'map',
  982. mapType: 'china',
  983. itemStyle:{
  984. normal:{label:{show:true}},
  985. emphasis:{label:{show:true}}
  986. },
  987. data:[
  988. {name: '北京',value: Math.round(Math.random()*1000)},
  989. {name: '天津',value: Math.round(Math.random()*1000)},
  990. {name: '上海',value: Math.round(Math.random()*1000)},
  991. {name: '广东',value: Math.round(Math.random()*1000)},
  992. {name: '台湾',value: Math.round(Math.random()*1000)},
  993. {name: '香港',value: Math.round(Math.random()*1000)},
  994. {name: '澳门',value: Math.round(Math.random()*1000)}
  995. ]
  996. }
  997. ]
  998. };
  999. mapChart.setOption(mapoption);
  1000. $(window).resize(mapChart.resize);
  1001. var gaugeChart = echarts.init(document.getElementById("echarts-gauge-chart"));
  1002. var gaugeoption = {
  1003. tooltip : {
  1004. formatter: "{a} <br/>{c} {b}"
  1005. },
  1006. toolbox: {
  1007. show : true,
  1008. feature : {
  1009. mark : {show: true},
  1010. restore : {show: true},
  1011. saveAsImage : {show: true}
  1012. }
  1013. },
  1014. series : [
  1015. {
  1016. name:'速度',
  1017. type:'gauge',
  1018. min:0,
  1019. max:220,
  1020. splitNumber:11,
  1021. axisLine: { // 坐标轴线
  1022. lineStyle: { // 属性lineStyle控制线条样式
  1023. width: 10
  1024. }
  1025. },
  1026. axisTick: { // 坐标轴小标记
  1027. length :15, // 属性length控制线长
  1028. lineStyle: { // 属性lineStyle控制线条样式
  1029. color: 'auto'
  1030. }
  1031. },
  1032. splitLine: { // 分隔线
  1033. length :20, // 属性length控制线长
  1034. lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
  1035. color: 'auto'
  1036. }
  1037. },
  1038. title : {
  1039. textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  1040. fontWeight: 'bolder',
  1041. fontSize: 20,
  1042. fontStyle: 'italic'
  1043. }
  1044. },
  1045. detail : {
  1046. textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  1047. fontWeight: 'bolder'
  1048. }
  1049. },
  1050. data:[{value: 40, name: 'km/h'}]
  1051. },
  1052. {
  1053. name:'转速',
  1054. type:'gauge',
  1055. center : ['25%', '55%'], // 默认全局居中
  1056. radius : '50%',
  1057. min:0,
  1058. max:7,
  1059. endAngle:45,
  1060. splitNumber:7,
  1061. axisLine: { // 坐标轴线
  1062. lineStyle: { // 属性lineStyle控制线条样式
  1063. width: 8
  1064. }
  1065. },
  1066. axisTick: { // 坐标轴小标记
  1067. length :12, // 属性length控制线长
  1068. lineStyle: { // 属性lineStyle控制线条样式
  1069. color: 'auto'
  1070. }
  1071. },
  1072. splitLine: { // 分隔线
  1073. length :20, // 属性length控制线长
  1074. lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
  1075. color: 'auto'
  1076. }
  1077. },
  1078. pointer: {
  1079. width:5
  1080. },
  1081. title : {
  1082. offsetCenter: [0, '-30%'], // x, y,单位px
  1083. },
  1084. detail : {
  1085. textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  1086. fontWeight: 'bolder'
  1087. }
  1088. },
  1089. data:[{value: 1.5, name: 'x1000 r/min'}]
  1090. },
  1091. {
  1092. name:'油表',
  1093. type:'gauge',
  1094. center : ['75%', '50%'], // 默认全局居中
  1095. radius : '50%',
  1096. min:0,
  1097. max:2,
  1098. startAngle:135,
  1099. endAngle:45,
  1100. splitNumber:2,
  1101. axisLine: { // 坐标轴线
  1102. lineStyle: { // 属性lineStyle控制线条样式
  1103. color: [
  1104. [0.2, '#ff4500'],[0.8, '#48b'],[1, '#228b22']
  1105. ],
  1106. width: 8
  1107. }
  1108. },
  1109. axisTick: { // 坐标轴小标记
  1110. splitNumber:5,
  1111. length :10, // 属性length控制线长
  1112. lineStyle: { // 属性lineStyle控制线条样式
  1113. color: 'auto'
  1114. }
  1115. },
  1116. axisLabel: {
  1117. formatter:function(v){
  1118. switch (v + '') {
  1119. case '0' : return 'E';
  1120. case '1' : return 'Gas';
  1121. case '2' : return 'F';
  1122. }
  1123. }
  1124. },
  1125. splitLine: { // 分隔线
  1126. length :15, // 属性length控制线长
  1127. lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
  1128. color: 'auto'
  1129. }
  1130. },
  1131. pointer: {
  1132. width:2
  1133. },
  1134. title : {
  1135. show: false
  1136. },
  1137. detail : {
  1138. show: false
  1139. },
  1140. data:[{value: 0.5, name: 'gas'}]
  1141. },
  1142. {
  1143. name:'水表',
  1144. type:'gauge',
  1145. center : ['75%', '50%'], // 默认全局居中
  1146. radius : '50%',
  1147. min:0,
  1148. max:2,
  1149. startAngle:315,
  1150. endAngle:225,
  1151. splitNumber:2,
  1152. axisLine: { // 坐标轴线
  1153. lineStyle: { // 属性lineStyle控制线条样式
  1154. color: [
  1155. [0.2, '#ff4500'],[0.8, '#48b'],[1, '#228b22']
  1156. ],
  1157. width: 8
  1158. }
  1159. },
  1160. axisTick: { // 坐标轴小标记
  1161. show: false
  1162. },
  1163. axisLabel: {
  1164. formatter:function(v){
  1165. switch (v + '') {
  1166. case '0' : return 'H';
  1167. case '1' : return 'Water';
  1168. case '2' : return 'C';
  1169. }
  1170. }
  1171. },
  1172. splitLine: { // 分隔线
  1173. length :15, // 属性length控制线长
  1174. lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
  1175. color: 'auto'
  1176. }
  1177. },
  1178. pointer: {
  1179. width:2
  1180. },
  1181. title : {
  1182. show: false
  1183. },
  1184. detail : {
  1185. show: false
  1186. },
  1187. data:[{value: 0.5, name: 'gas'}]
  1188. }
  1189. ]
  1190. };
  1191. gaugeChart.setOption(gaugeoption);
  1192. $(window).resize(gaugeChart.resize);
  1193. var funnelChart = echarts.init(document.getElementById("echarts-funnel-chart"));
  1194. var funneloption = {
  1195. title : {
  1196. text: '漏斗图',
  1197. subtext: '纯属虚构'
  1198. },
  1199. tooltip : {
  1200. trigger: 'item',
  1201. formatter: "{a} <br/>{b} : {c}%"
  1202. },
  1203. legend: {
  1204. data : ['展现','点击','访问','咨询','订单']
  1205. },
  1206. calculable : true,
  1207. series : [
  1208. {
  1209. name:'漏斗图',
  1210. type:'funnel',
  1211. width: '40%',
  1212. data:[
  1213. {value:60, name:'访问'},
  1214. {value:40, name:'咨询'},
  1215. {value:20, name:'订单'},
  1216. {value:80, name:'点击'},
  1217. {value:100, name:'展现'}
  1218. ]
  1219. },
  1220. {
  1221. name:'金字塔',
  1222. type:'funnel',
  1223. x : '50%',
  1224. sort : 'ascending',
  1225. itemStyle: {
  1226. normal: {
  1227. // color: 各异,
  1228. label: {
  1229. position: 'left'
  1230. }
  1231. }
  1232. },
  1233. data:[
  1234. {value:60, name:'访问'},
  1235. {value:40, name:'咨询'},
  1236. {value:20, name:'订单'},
  1237. {value:80, name:'点击'},
  1238. {value:100, name:'展现'}
  1239. ]
  1240. }
  1241. ]
  1242. };
  1243. funnelChart.setOption(funneloption);
  1244. $(window).resize(funnelChart.resize);
  1245. });
  1246. </script>
  1247. </body>
  1248. </html>