bar11.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <meta name="description" content="ECharts">
  8. <meta name="author" content="kener.linfeng@gmail.com">
  9. <title>ECharts · Example</title>
  10. <link rel="shortcut icon" href="../asset/ico/favicon.png">
  11. <link href="../asset/css/font-awesome.min.css" rel="stylesheet">
  12. <link href="../asset/css/bootstrap.css" rel="stylesheet">
  13. <link href="../asset/css/carousel.css" rel="stylesheet">
  14. <link href="../asset/css/echartsHome.css" rel="stylesheet">
  15. <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  16. <!--[if lt IE 9]>
  17. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  18. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  19. <![endif]-->
  20. <script src="./www/js/echarts.js"></script>
  21. <script src="../asset/js/codemirror.js"></script>
  22. <script src="../asset/js/javascript.js"></script>
  23. <link href="../asset/css/codemirror.css" rel="stylesheet">
  24. <link href="../asset/css/monokai.css" rel="stylesheet">
  25. </head>
  26. <body>
  27. <!-- Fixed navbar -->
  28. <div class="navbar navbar-default navbar-fixed-top" role="navigation" id="head"></div>
  29. <div class="container-fluid">
  30. <div class="row-fluid example">
  31. <div id="sidebar-code" class="col-md-4">
  32. <div class="well sidebar-nav">
  33. <div class="nav-header"><a href="#" onclick="autoResize()" class="glyphicon glyphicon-resize-full" id ="icon-resize" ></a>option</div>
  34. <textarea id="code" name="code">
  35. option = {
  36. timeline:{
  37. data:[
  38. '2002-01-01','2003-01-01','2004-01-01','2005-01-01','2006-01-01',
  39. '2007-01-01','2008-01-01','2009-01-01','2010-01-01','2011-01-01'
  40. ],
  41. label : {
  42. formatter : function(s) {
  43. return s.slice(0, 4);
  44. }
  45. },
  46. autoPlay : true,
  47. playInterval : 1000
  48. },
  49. options:[
  50. {
  51. title : {
  52. 'text':'2002全国宏观经济指标',
  53. 'subtext':'数据来自国家统计局'
  54. },
  55. tooltip : {'trigger':'axis'},
  56. legend : {
  57. x:'right',
  58. 'data':['GDP','金融','房地产','第一产业','第二产业','第三产业'],
  59. 'selected':{
  60. 'GDP':true,
  61. '金融':false,
  62. '房地产':true,
  63. '第一产业':false,
  64. '第二产业':false,
  65. '第三产业':false
  66. }
  67. },
  68. toolbox : {
  69. 'show':true,
  70. orient : 'vertical',
  71. x: 'right',
  72. y: 'center',
  73. 'feature':{
  74. 'mark':{'show':true},
  75. 'dataView':{'show':true,'readOnly':false},
  76. 'magicType':{'show':true,'type':['line','bar','stack','tiled']},
  77. 'restore':{'show':true},
  78. 'saveAsImage':{'show':true}
  79. }
  80. },
  81. calculable : true,
  82. grid : {'y':80,'y2':100},
  83. xAxis : [{
  84. 'type':'category',
  85. 'axisLabel':{'interval':0},
  86. 'data':[
  87. '北京','\n天津','河北','\n山西','内蒙古','\n辽宁','吉林','\n黑龙江',
  88. '上海','\n江苏','浙江','\n安徽','福建','\n江西','山东','\n河南',
  89. '湖北','\n湖南','广东','\n广西','海南','\n重庆','四川','\n贵州',
  90. '云南','\n西藏','陕西','\n甘肃','青海','\n宁夏','新疆'
  91. ]
  92. }],
  93. yAxis : [
  94. {
  95. 'type':'value',
  96. 'name':'GDP(亿元)',
  97. 'max':53500
  98. },
  99. {
  100. 'type':'value',
  101. 'name':'其他(亿元)'
  102. }
  103. ],
  104. series : [
  105. {
  106. 'name':'GDP',
  107. 'type':'bar',
  108. 'markLine':{
  109. symbol : ['arrow','none'],
  110. symbolSize : [4, 2],
  111. itemStyle : {
  112. normal: {
  113. lineStyle: {color:'orange'},
  114. barBorderColor:'orange',
  115. label:{
  116. position:'left',
  117. formatter:function(params){
  118. return Math.round(params.value);
  119. },
  120. textStyle:{color:'orange'}
  121. }
  122. }
  123. },
  124. 'data':[{'type':'average','name':'平均值'}]
  125. },
  126. 'data': dataMap.dataGDP['2002']
  127. },
  128. {
  129. 'name':'金融','yAxisIndex':1,'type':'bar',
  130. 'data': dataMap.dataFinancial['2002']
  131. },
  132. {
  133. 'name':'房地产','yAxisIndex':1,'type':'bar',
  134. 'data': dataMap.dataEstate['2002']
  135. },
  136. {
  137. 'name':'第一产业','yAxisIndex':1,'type':'bar',
  138. 'data': dataMap.dataPI['2002']
  139. },
  140. {
  141. 'name':'第二产业','yAxisIndex':1,'type':'bar',
  142. 'data': dataMap.dataSI['2002']
  143. },
  144. {
  145. 'name':'第三产业','yAxisIndex':1,'type':'bar',
  146. 'data': dataMap.dataTI['2002']
  147. }
  148. ]
  149. },
  150. {
  151. title : {'text':'2003全国宏观经济指标'},
  152. series : [
  153. {'data': dataMap.dataGDP['2003']},
  154. {'data': dataMap.dataFinancial['2003']},
  155. {'data': dataMap.dataEstate['2003']},
  156. {'data': dataMap.dataPI['2003']},
  157. {'data': dataMap.dataSI['2003']},
  158. {'data': dataMap.dataTI['2003']}
  159. ]
  160. },
  161. {
  162. title : {'text':'2004全国宏观经济指标'},
  163. series : [
  164. {'data': dataMap.dataGDP['2004']},
  165. {'data': dataMap.dataFinancial['2004']},
  166. {'data': dataMap.dataEstate['2004']},
  167. {'data': dataMap.dataPI['2004']},
  168. {'data': dataMap.dataSI['2004']},
  169. {'data': dataMap.dataTI['2004']}
  170. ]
  171. },
  172. {
  173. title : {'text':'2005全国宏观经济指标'},
  174. series : [
  175. {'data': dataMap.dataGDP['2005']},
  176. {'data': dataMap.dataFinancial['2005']},
  177. {'data': dataMap.dataEstate['2005']},
  178. {'data': dataMap.dataPI['2005']},
  179. {'data': dataMap.dataSI['2005']},
  180. {'data': dataMap.dataTI['2005']}
  181. ]
  182. },
  183. {
  184. title : {'text':'2006全国宏观经济指标'},
  185. series : [
  186. {'data': dataMap.dataGDP['2006']},
  187. {'data': dataMap.dataFinancial['2006']},
  188. {'data': dataMap.dataEstate['2006']},
  189. {'data': dataMap.dataPI['2006']},
  190. {'data': dataMap.dataSI['2006']},
  191. {'data': dataMap.dataTI['2006']}
  192. ]
  193. },
  194. {
  195. title : {'text':'2007全国宏观经济指标'},
  196. series : [
  197. {'data': dataMap.dataGDP['2007']},
  198. {'data': dataMap.dataFinancial['2007']},
  199. {'data': dataMap.dataEstate['2007']},
  200. {'data': dataMap.dataPI['2007']},
  201. {'data': dataMap.dataSI['2007']},
  202. {'data': dataMap.dataTI['2007']}
  203. ]
  204. },
  205. {
  206. title : {'text':'2008全国宏观经济指标'},
  207. series : [
  208. {'data': dataMap.dataGDP['2008']},
  209. {'data': dataMap.dataFinancial['2008']},
  210. {'data': dataMap.dataEstate['2008']},
  211. {'data': dataMap.dataPI['2008']},
  212. {'data': dataMap.dataSI['2008']},
  213. {'data': dataMap.dataTI['2008']}
  214. ]
  215. },
  216. {
  217. title : {'text':'2009全国宏观经济指标'},
  218. series : [
  219. {'data': dataMap.dataGDP['2009']},
  220. {'data': dataMap.dataFinancial['2009']},
  221. {'data': dataMap.dataEstate['2009']},
  222. {'data': dataMap.dataPI['2009']},
  223. {'data': dataMap.dataSI['2009']},
  224. {'data': dataMap.dataTI['2009']}
  225. ]
  226. },
  227. {
  228. title : {'text':'2010全国宏观经济指标'},
  229. series : [
  230. {'data': dataMap.dataGDP['2010']},
  231. {'data': dataMap.dataFinancial['2010']},
  232. {'data': dataMap.dataEstate['2010']},
  233. {'data': dataMap.dataPI['2010']},
  234. {'data': dataMap.dataSI['2010']},
  235. {'data': dataMap.dataTI['2010']}
  236. ]
  237. },
  238. {
  239. title : {'text':'2011全国宏观经济指标'},
  240. series : [
  241. {'data': dataMap.dataGDP['2011']},
  242. {'data': dataMap.dataFinancial['2011']},
  243. {'data': dataMap.dataEstate['2011']},
  244. {'data': dataMap.dataPI['2011']},
  245. {'data': dataMap.dataSI['2011']},
  246. {'data': dataMap.dataTI['2011']}
  247. ]
  248. }
  249. ]
  250. };
  251. </textarea>
  252. </div><!--/.well -->
  253. </div><!--/span-->
  254. <div id="graphic" class="col-md-8">
  255. <div id="main" class="main"></div>
  256. <div>
  257. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  258. <span class="text-primary">切换主题</span>
  259. <select id="theme-select"></select>
  260. <span id='wrong-message' style="color:red"></span>
  261. </div>
  262. </div><!--/span-->
  263. </div><!--/row-->
  264. </div><!--/.fluid-container-->
  265. <footer id="footer"></footer>
  266. <!-- Le javascript
  267. ================================================== -->
  268. <!-- Placed at the end of the document so the pages load faster -->
  269. <script src="../asset/js/jquery.min.js"></script>
  270. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  271. <script src="../asset/js/bootstrap.min.js"></script>
  272. <script src="timelineOption.js"></script>
  273. <script src="../asset/js/echartsExample.js"></script>
  274. </body>
  275. </html>