map12.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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. <style type="text/css">
  26. .CodeMirror {
  27. height: 550px;
  28. }
  29. </style>
  30. </head>
  31. <body>
  32. <!-- Fixed navbar -->
  33. <div class="navbar navbar-default navbar-fixed-top" role="navigation" id="head"></div>
  34. <div class="container-fluid">
  35. <div class="row-fluid example">
  36. <div id="sidebar-code" class="col-md-4">
  37. <div class="well sidebar-nav">
  38. <div class="nav-header"><a href="#" onclick="autoResize()" class="glyphicon glyphicon-resize-full" id ="icon-resize" ></a>option</div>
  39. <textarea id="code" name="code">
  40. var effect = {
  41. show: true,
  42. scaleSize: require('zrender/tool/env').canvasSupported ? 1 : 2,
  43. period: 30, // 运动周期,无单位,值越大越慢
  44. color: '#fff',
  45. shadowColor: 'rgba(220,220,220,0.4)',
  46. shadowBlur : 5
  47. };
  48. function itemStyle(idx) {
  49. return {
  50. normal: {
  51. color:'#fff',
  52. borderWidth:1,
  53. borderColor:['rgba(30,144,255,1)','lime'][idx],
  54. lineStyle: {
  55. //shadowColor : ['rgba(30,144,255,1)','lime'][idx], //默认透明
  56. //shadowBlur: 10,
  57. //shadowOffsetX: 0,
  58. //shadowOffsetY: 0,
  59. type: 'solid'
  60. }
  61. }
  62. }
  63. };
  64. option = {
  65. backgroundColor: '#1b1b1b',
  66. color: ['rgba(30,144,255,1)','lime'],
  67. title : {
  68. text: '中国铁路运输主干线',
  69. subtext:'数据来自维基百科',
  70. sublink: 'http://zh.wikipedia.org/wiki/%E4%B8%AD%E5%8D%8E%E4%BA%BA%E6%B0%91%E5%85%B1%E5%92%8C%E5%9B%BD%E9%93%81%E8%B7%AF%E8%BF%90%E8%BE%93',
  71. x:'center',
  72. textStyle : {
  73. color: '#fff'
  74. }
  75. },
  76. tooltip : {
  77. trigger: 'item',
  78. formatter: '{b}'
  79. },
  80. legend: {
  81. orient: 'vertical',
  82. x:'left',
  83. selectedMode:'single',
  84. data:['八纵通道', '八横通道'],
  85. textStyle : {
  86. color: '#fff'
  87. }
  88. },
  89. toolbox: {
  90. show : true,
  91. orient : 'vertical',
  92. x: 'right',
  93. y: 'center',
  94. feature : {
  95. mark : {show: true},
  96. dataView : {show: true, readOnly: false},
  97. restore : {show: true},
  98. saveAsImage : {show: true}
  99. }
  100. },
  101. series : [
  102. {
  103. name: '八纵通道',
  104. type: 'map',
  105. roam: true,
  106. hoverable: false,
  107. mapType: 'china',
  108. itemStyle:{
  109. normal:{
  110. borderColor:'rgba(100,149,237,1)',
  111. borderWidth:0.5,
  112. areaStyle:{
  113. color: '#1b1b1b'
  114. }
  115. }
  116. },
  117. data:[],
  118. markLine : {
  119. symbol: ['circle', 'circle'],
  120. symbolSize : 1,
  121. effect : effect,
  122. itemStyle : itemStyle(0),
  123. smooth:true,
  124. data : [
  125. [{name:'北京'}, {name:'哈尔滨'}],
  126. [{name:'哈尔滨'}, {name:'满洲里'}],
  127. [{name:'沈阳'}, {name:'大连'}],
  128. [{name:'大连'}, {name:'烟台'}],
  129. [{name:'烟台'}, {name:'青岛'}],
  130. [{name:'青岛'}, {name:'淮安'}],
  131. [{name:'淮安'}, {name:'上海'}],
  132. [{name:'上海'}, {name:'杭州'}],
  133. [{name:'杭州'}, {name:'宁波'}],
  134. [{name:'宁波'}, {name:'温州'}],
  135. [{name:'温州'}, {name:'福州'}],
  136. [{name:'福州'}, {name:'厦门'}],
  137. [{name:'厦门'}, {name:'广州'}],
  138. [{name:'广州'}, {name:'湛江'}],
  139. [{name:'北京'}, {name:'天津'}],
  140. [{name:'天津'}, {name:'济南'}],
  141. [{name:'济南'}, {name:'南京'}],
  142. [{name:'南京'}, {name:'上海'}],
  143. [{name:'北京'}, {name:'南昌'}],
  144. [{name:'南昌'}, {name:'深圳'}],
  145. [{name:'深圳'}, {name:'九龙红磡'}],
  146. [{name:'北京'}, {name:'郑州'}],
  147. [{name:'郑州'}, {name:'武汉'}],
  148. [{name:'武汉'}, {name:'广州'}],
  149. [{name:'大同'}, {name:'太原'}],
  150. [{name:'太原'}, {name:'焦作'}],
  151. [{name:'焦作'}, {name:'洛阳'}],
  152. [{name:'洛阳'}, {name:'柳州'}],
  153. [{name:'柳州'}, {name:'湛江'}],
  154. [{name:'包头'}, {name:'西安'}],
  155. [{name:'西安'}, {name:'重庆'}],
  156. [{name:'重庆'}, {name:'贵阳'}],
  157. [{name:'贵阳'}, {name:'柳州'}],
  158. [{name:'柳州'}, {name:'南宁'}],
  159. [{name:'兰州'}, {name:'成都'}],
  160. [{name:'成都'}, {name:'昆明'}]
  161. ]
  162. }
  163. },
  164. {
  165. name: '八横通道',
  166. type: 'map',
  167. mapType: 'china',
  168. itedmStyle:{
  169. normal:{
  170. borderColor:'rgba(100,149,237,1)',
  171. borderWidth:0.5,
  172. areaStyle:{
  173. color: '#1b1b1b'
  174. }
  175. }
  176. },
  177. data:[],
  178. markLine : {
  179. symbol: ['circle', 'circle'],
  180. symbolSize : 1,
  181. effect : effect,
  182. itemStyle : itemStyle(1),
  183. smooth:true,
  184. data : [
  185. [{name:'北京'}, {name:'兰州'}],
  186. [{name:'兰州'}, {name:'拉萨'}],
  187. [{name:'大同'}, {name:'秦皇岛'}],
  188. [{name:'神木'}, {name:'黄骅'}],
  189. [{name:'太原'}, {name:'德州'}],
  190. [{name:'德州'}, {name:'龙口'}],
  191. [{name:'龙口'}, {name:'烟台'}],
  192. [{name:'太原'}, {name:'德州'}],
  193. [{name:'德州'}, {name:'济南'}],
  194. [{name:'济南'}, {name:'青岛'}],
  195. [{name:'长治'}, {name:'邯郸'}],
  196. [{name:'邯郸'}, {name:'济南'}],
  197. [{name:'济南'}, {name:'青岛'}],
  198. [{name:'瓦塘'}, {name:'临汾'}],
  199. [{name:'临汾'}, {name:'长治'}],
  200. [{name:'长治'}, {name:'汤阴'}],
  201. [{name:'汤阴'}, {name:'台前'}],
  202. [{name:'台前'}, {name:'兖州'}],
  203. [{name:'兖州'}, {name:'日照'}],
  204. [{name:'侯马'}, {name:'月山'}],
  205. [{name:'月山'}, {name:'新乡'}],
  206. [{name:'新乡'}, {name:'兖州'}],
  207. [{name:'兖州'}, {name:'日照'}],
  208. [{name:'连云港'}, {name:'郑州'}],
  209. [{name:'郑州'}, {name:'兰州'}],
  210. [{name:'兰州'}, {name:'乌鲁木齐'}],
  211. [{name:'乌鲁木齐'}, {name:'阿拉山口'}],
  212. [{name:'西安'}, {name:'南阳'}],
  213. [{name:'南阳'}, {name:'信阳'}],
  214. [{name:'信阳'}, {name:'合肥'}],
  215. [{name:'合肥'}, {name:'南京'}],
  216. [{name:'南京'}, {name:'启东'}],
  217. [{name:'重庆'}, {name:'武汉'}],
  218. [{name:'武汉'}, {name:'九江'}],
  219. [{name:'九江'}, {name:'铜陵'}],
  220. [{name:'铜陵'}, {name:'南京'}],
  221. [{name:'南京'}, {name:'上海'}],
  222. [{name:'上海'}, {name:'怀化'}],
  223. [{name:'怀化'}, {name:'重庆'}],
  224. [{name:'重庆'}, {name:'成都'}],
  225. [{name:'成都'}, {name:'贵阳'}],
  226. [{name:'贵阳'}, {name:'昆明'}],
  227. [{name:'昆明'}, {name:'南宁'}],
  228. [{name:'南宁'}, {name:'黎塘'}],
  229. [{name:'黎塘'}, {name:'湛江'}]
  230. ]
  231. },
  232. geoCoord: {
  233. '阿拉山口':[82.5757,45.1706],
  234. '包头':[109.8403,40.6574],
  235. '北京':[116.4075,39.9040],
  236. '成都':[104.0665,30.5723],
  237. '大连':[121.6147,38.9140],
  238. '大同':[113.3001,40.0768],
  239. '德州':[116.3575,37.4341],
  240. '福州':[119.2965,26.0745],
  241. '广州':[113.2644,23.1292],
  242. '贵阳':[106.6302,26.6477],
  243. '哈尔滨':[126.5363,45.8023],
  244. '邯郸':[114.5391,36.6256],
  245. '杭州':[120.1551,30.2741],
  246. '合肥':[117.2272,31.8206],
  247. '侯马':[111.3720,35.6191],
  248. '怀化':[109.9985,27.5550],
  249. '淮安':[119.0153,33.6104],
  250. '黄骅':[117.3300,38.3714],
  251. '济南':[117.1205,36.6510],
  252. '焦作':[113.2418,35.2159],
  253. '九江':[116.0019,29.7051],
  254. '九龙红磡':[114.1870,22.3076],
  255. '昆明':[102.8329,24.8801],
  256. '拉萨':[91.1409,29.6456],
  257. '兰州':[103.8343,36.0611],
  258. '黎塘':[109.1363,23.2066],
  259. '连云港':[119.2216,34.5967],
  260. '临汾':[111.5190,36.0880],
  261. '柳州':[109.4160,24.3255],
  262. '龙口':[120.4778,37.6461],
  263. '洛阳':[112.4540,34.6197],
  264. '满洲里':[117.3787,49.5978],
  265. '南昌':[115.8581,28.6832],
  266. '南京':[118.7969,32.0603],
  267. '南宁':[108.3661,22.8172],
  268. '南阳':[112.5283,32.9908],
  269. '宁波':[121.5440,29.8683],
  270. '启东':[121.6574,31.8082],
  271. '秦皇岛':[119.6005,39.9354],
  272. '青岛':[120.3826,36.0671],
  273. '日照':[119.5269,35.4164],
  274. '厦门':[118.0894,24.4798],
  275. '上海':[121.4737,31.2304],
  276. '深圳':[114.0579,22.5431],
  277. '神木':[110.4871,38.8610],
  278. '沈阳':[123.4315,41.8057],
  279. '台前':[115.8717,35.9701],
  280. '太原':[112.5489,37.8706],
  281. '汤阴':[114.3572,35.9218],
  282. '天津':[117.2010,39.0842],
  283. '铜陵':[117.8121,30.9454],
  284. '瓦塘':[109.7600,23.3161],
  285. '温州':[120.6994,27.9943],
  286. '乌鲁木齐':[87.6168,43.8256],
  287. '武汉':[114.3054,30.5931],
  288. '西安':[108.9402,34.3416],
  289. '新乡':[113.9268,35.3030],
  290. '信阳':[114.0913,32.1470],
  291. '烟台':[121.4479,37.4638],
  292. '兖州':[116.7838,35.5531],
  293. '月山':[113.0550,35.2104],
  294. '湛江':[110.3594,21.2707],
  295. '长治':[113.1163,36.1954],
  296. '郑州':[113.6254,34.7466],
  297. '重庆':[106.5516,29.5630]
  298. }
  299. }
  300. ]
  301. };
  302. </textarea>
  303. </div><!--/.well -->
  304. </div><!--/span-->
  305. <div id="graphic" class="col-md-8">
  306. <div id="main" class="main" style="height: 530px;"></div>
  307. <div>
  308. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  309. <span class="text-primary">切换主题</span>
  310. <select id="theme-select"></select>
  311. <span id='wrong-message' style="color:red"></span>
  312. </div>
  313. </div><!--/span-->
  314. </div><!--/row-->
  315. </div><!--/.fluid-container-->
  316. <footer id="footer"></footer>
  317. <!-- Le javascript
  318. ================================================== -->
  319. <!-- Placed at the end of the document so the pages load faster -->
  320. <script src="../asset/js/jquery.min.js"></script>
  321. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  322. <script src="../asset/js/bootstrap.min.js"></script>
  323. <script src="../asset/js/echartsExample.js"></script>
  324. </body>
  325. </html>