map9.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  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. option = {
  41. title : {
  42. text: '全国主要城市空气质量(pm2.5)',
  43. subtext: 'data from PM25.in',
  44. sublink: 'http://www.pm25.in',
  45. x:'center'
  46. },
  47. tooltip : {
  48. trigger: 'item'
  49. },
  50. legend: {
  51. orient: 'vertical',
  52. x:'left',
  53. data:['pm2.5']
  54. },
  55. dataRange: {
  56. min : 0,
  57. max : 500,
  58. calculable : true,
  59. color: ['maroon','purple','red','orange','yellow','lightgreen']
  60. },
  61. toolbox: {
  62. show : true,
  63. orient : 'vertical',
  64. x: 'right',
  65. y: 'center',
  66. feature : {
  67. mark : {show: true},
  68. dataView : {show: true, readOnly: false},
  69. restore : {show: true},
  70. saveAsImage : {show: true}
  71. }
  72. },
  73. series : [
  74. {
  75. name: 'pm2.5',
  76. type: 'map',
  77. mapType: 'china',
  78. hoverable: false,
  79. roam:true,
  80. data : [],
  81. markPoint : {
  82. symbolSize: 5, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
  83. itemStyle: {
  84. normal: {
  85. borderColor: '#87cefa',
  86. borderWidth: 1, // 标注边线线宽,单位px,默认为1
  87. label: {
  88. show: false
  89. }
  90. },
  91. emphasis: {
  92. borderColor: '#1e90ff',
  93. borderWidth: 5,
  94. label: {
  95. show: false
  96. }
  97. }
  98. },
  99. data : [
  100. {name: "海门", value: 9},
  101. {name: "鄂尔多斯", value: 12},
  102. {name: "招远", value: 12},
  103. {name: "舟山", value: 12},
  104. {name: "齐齐哈尔", value: 14},
  105. {name: "盐城", value: 15},
  106. {name: "赤峰", value: 16},
  107. {name: "青岛", value: 18},
  108. {name: "乳山", value: 18},
  109. {name: "金昌", value: 19},
  110. {name: "泉州", value: 21},
  111. {name: "莱西", value: 21},
  112. {name: "日照", value: 21},
  113. {name: "胶南", value: 22},
  114. {name: "南通", value: 23},
  115. {name: "拉萨", value: 24},
  116. {name: "云浮", value: 24},
  117. {name: "梅州", value: 25},
  118. {name: "文登", value: 25},
  119. {name: "上海", value: 25},
  120. {name: "攀枝花", value: 25},
  121. {name: "威海", value: 25},
  122. {name: "承德", value: 25},
  123. {name: "厦门", value: 26},
  124. {name: "汕尾", value: 26},
  125. {name: "潮州", value: 26},
  126. {name: "丹东", value: 27},
  127. {name: "太仓", value: 27},
  128. {name: "曲靖", value: 27},
  129. {name: "烟台", value: 28},
  130. {name: "福州", value: 29},
  131. {name: "瓦房店", value: 30},
  132. {name: "即墨", value: 30},
  133. {name: "抚顺", value: 31},
  134. {name: "玉溪", value: 31},
  135. {name: "张家口", value: 31},
  136. {name: "阳泉", value: 31},
  137. {name: "莱州", value: 32},
  138. {name: "湖州", value: 32},
  139. {name: "汕头", value: 32},
  140. {name: "昆山", value: 33},
  141. {name: "宁波", value: 33},
  142. {name: "湛江", value: 33},
  143. {name: "揭阳", value: 34},
  144. {name: "荣成", value: 34},
  145. {name: "连云港", value: 35},
  146. {name: "葫芦岛", value: 35},
  147. {name: "常熟", value: 36},
  148. {name: "东莞", value: 36},
  149. {name: "河源", value: 36},
  150. {name: "淮安", value: 36},
  151. {name: "泰州", value: 36},
  152. {name: "南宁", value: 37},
  153. {name: "营口", value: 37},
  154. {name: "惠州", value: 37},
  155. {name: "江阴", value: 37},
  156. {name: "蓬莱", value: 37},
  157. {name: "韶关", value: 38},
  158. {name: "嘉峪关", value: 38},
  159. {name: "广州", value: 38},
  160. {name: "延安", value: 38},
  161. {name: "太原", value: 39},
  162. {name: "清远", value: 39},
  163. {name: "中山", value: 39},
  164. {name: "昆明", value: 39},
  165. {name: "寿光", value: 40},
  166. {name: "盘锦", value: 40},
  167. {name: "长治", value: 41},
  168. {name: "深圳", value: 41},
  169. {name: "珠海", value: 42},
  170. {name: "宿迁", value: 43},
  171. {name: "咸阳", value: 43},
  172. {name: "铜川", value: 44},
  173. {name: "平度", value: 44},
  174. {name: "佛山", value: 44},
  175. {name: "海口", value: 44},
  176. {name: "江门", value: 45},
  177. {name: "章丘", value: 45},
  178. {name: "肇庆", value: 46},
  179. {name: "大连", value: 47},
  180. {name: "临汾", value: 47},
  181. {name: "吴江", value: 47},
  182. {name: "石嘴山", value: 49},
  183. {name: "沈阳", value: 50},
  184. {name: "苏州", value: 50},
  185. {name: "茂名", value: 50},
  186. {name: "嘉兴", value: 51},
  187. {name: "长春", value: 51},
  188. {name: "胶州", value: 52},
  189. {name: "银川", value: 52},
  190. {name: "张家港", value: 52},
  191. {name: "三门峡", value: 53},
  192. {name: "锦州", value: 54},
  193. {name: "南昌", value: 54},
  194. {name: "柳州", value: 54},
  195. {name: "三亚", value: 54},
  196. {name: "自贡", value: 56},
  197. {name: "吉林", value: 56},
  198. {name: "阳江", value: 57},
  199. {name: "泸州", value: 57},
  200. {name: "西宁", value: 57},
  201. {name: "宜宾", value: 58},
  202. {name: "呼和浩特", value: 58},
  203. {name: "成都", value: 58},
  204. {name: "大同", value: 58},
  205. {name: "镇江", value: 59},
  206. {name: "桂林", value: 59},
  207. {name: "张家界", value: 59},
  208. {name: "宜兴", value: 59},
  209. {name: "北海", value: 60},
  210. {name: "西安", value: 61},
  211. {name: "金坛", value: 62},
  212. {name: "东营", value: 62},
  213. {name: "牡丹江", value: 63},
  214. {name: "遵义", value: 63},
  215. {name: "绍兴", value: 63},
  216. {name: "扬州", value: 64},
  217. {name: "常州", value: 64},
  218. {name: "潍坊", value: 65},
  219. {name: "重庆", value: 66},
  220. {name: "台州", value: 67},
  221. {name: "南京", value: 67},
  222. {name: "滨州", value: 70},
  223. {name: "贵阳", value: 71},
  224. {name: "无锡", value: 71},
  225. {name: "本溪", value: 71},
  226. {name: "克拉玛依", value: 72},
  227. {name: "渭南", value: 72},
  228. {name: "马鞍山", value: 72},
  229. {name: "宝鸡", value: 72},
  230. {name: "焦作", value: 75},
  231. {name: "句容", value: 75},
  232. {name: "北京", value: 79},
  233. {name: "徐州", value: 79},
  234. {name: "衡水", value: 80},
  235. {name: "包头", value: 80},
  236. {name: "绵阳", value: 80},
  237. {name: "乌鲁木齐", value: 84},
  238. {name: "枣庄", value: 84},
  239. {name: "杭州", value: 84},
  240. {name: "淄博", value: 85},
  241. {name: "鞍山", value: 86},
  242. {name: "溧阳", value: 86},
  243. {name: "库尔勒", value: 86},
  244. {name: "安阳", value: 90},
  245. {name: "开封", value: 90},
  246. {name: "济南", value: 92},
  247. {name: "德阳", value: 93},
  248. {name: "温州", value: 95},
  249. {name: "九江", value: 96},
  250. {name: "邯郸", value: 98},
  251. {name: "临安", value: 99},
  252. {name: "兰州", value: 99},
  253. {name: "沧州", value: 100},
  254. {name: "临沂", value: 103},
  255. {name: "南充", value: 104},
  256. {name: "天津", value: 105},
  257. {name: "富阳", value: 106},
  258. {name: "泰安", value: 112},
  259. {name: "诸暨", value: 112},
  260. {name: "郑州", value: 113},
  261. {name: "哈尔滨", value: 114},
  262. {name: "聊城", value: 116},
  263. {name: "芜湖", value: 117},
  264. {name: "唐山", value: 119},
  265. {name: "平顶山", value: 119},
  266. {name: "邢台", value: 119},
  267. {name: "德州", value: 120},
  268. {name: "济宁", value: 120},
  269. {name: "荆州", value: 127},
  270. {name: "宜昌", value: 130},
  271. {name: "义乌", value: 132},
  272. {name: "丽水", value: 133},
  273. {name: "洛阳", value: 134},
  274. {name: "秦皇岛", value: 136},
  275. {name: "株洲", value: 143},
  276. {name: "石家庄", value: 147},
  277. {name: "莱芜", value: 148},
  278. {name: "常德", value: 152},
  279. {name: "保定", value: 153},
  280. {name: "湘潭", value: 154},
  281. {name: "金华", value: 157},
  282. {name: "岳阳", value: 169},
  283. {name: "长沙", value: 175},
  284. {name: "衢州", value: 177},
  285. {name: "廊坊", value: 193},
  286. {name: "菏泽", value: 194},
  287. {name: "合肥", value: 229},
  288. {name: "武汉", value: 273},
  289. {name: "大庆", value: 279}
  290. ]
  291. },
  292. geoCoord: {
  293. "海门":[121.15,31.89],
  294. "鄂尔多斯":[109.781327,39.608266],
  295. "招远":[120.38,37.35],
  296. "舟山":[122.207216,29.985295],
  297. "齐齐哈尔":[123.97,47.33],
  298. "盐城":[120.13,33.38],
  299. "赤峰":[118.87,42.28],
  300. "青岛":[120.33,36.07],
  301. "乳山":[121.52,36.89],
  302. "金昌":[102.188043,38.520089],
  303. "泉州":[118.58,24.93],
  304. "莱西":[120.53,36.86],
  305. "日照":[119.46,35.42],
  306. "胶南":[119.97,35.88],
  307. "南通":[121.05,32.08],
  308. "拉萨":[91.11,29.97],
  309. "云浮":[112.02,22.93],
  310. "梅州":[116.1,24.55],
  311. "文登":[122.05,37.2],
  312. "上海":[121.48,31.22],
  313. "攀枝花":[101.718637,26.582347],
  314. "威海":[122.1,37.5],
  315. "承德":[117.93,40.97],
  316. "厦门":[118.1,24.46],
  317. "汕尾":[115.375279,22.786211],
  318. "潮州":[116.63,23.68],
  319. "丹东":[124.37,40.13],
  320. "太仓":[121.1,31.45],
  321. "曲靖":[103.79,25.51],
  322. "烟台":[121.39,37.52],
  323. "福州":[119.3,26.08],
  324. "瓦房店":[121.979603,39.627114],
  325. "即墨":[120.45,36.38],
  326. "抚顺":[123.97,41.97],
  327. "玉溪":[102.52,24.35],
  328. "张家口":[114.87,40.82],
  329. "阳泉":[113.57,37.85],
  330. "莱州":[119.942327,37.177017],
  331. "湖州":[120.1,30.86],
  332. "汕头":[116.69,23.39],
  333. "昆山":[120.95,31.39],
  334. "宁波":[121.56,29.86],
  335. "湛江":[110.359377,21.270708],
  336. "揭阳":[116.35,23.55],
  337. "荣成":[122.41,37.16],
  338. "连云港":[119.16,34.59],
  339. "葫芦岛":[120.836932,40.711052],
  340. "常熟":[120.74,31.64],
  341. "东莞":[113.75,23.04],
  342. "河源":[114.68,23.73],
  343. "淮安":[119.15,33.5],
  344. "泰州":[119.9,32.49],
  345. "南宁":[108.33,22.84],
  346. "营口":[122.18,40.65],
  347. "惠州":[114.4,23.09],
  348. "江阴":[120.26,31.91],
  349. "蓬莱":[120.75,37.8],
  350. "韶关":[113.62,24.84],
  351. "嘉峪关":[98.289152,39.77313],
  352. "广州":[113.23,23.16],
  353. "延安":[109.47,36.6],
  354. "太原":[112.53,37.87],
  355. "清远":[113.01,23.7],
  356. "中山":[113.38,22.52],
  357. "昆明":[102.73,25.04],
  358. "寿光":[118.73,36.86],
  359. "盘锦":[122.070714,41.119997],
  360. "长治":[113.08,36.18],
  361. "深圳":[114.07,22.62],
  362. "珠海":[113.52,22.3],
  363. "宿迁":[118.3,33.96],
  364. "咸阳":[108.72,34.36],
  365. "铜川":[109.11,35.09],
  366. "平度":[119.97,36.77],
  367. "佛山":[113.11,23.05],
  368. "海口":[110.35,20.02],
  369. "江门":[113.06,22.61],
  370. "章丘":[117.53,36.72],
  371. "肇庆":[112.44,23.05],
  372. "大连":[121.62,38.92],
  373. "临汾":[111.5,36.08],
  374. "吴江":[120.63,31.16],
  375. "石嘴山":[106.39,39.04],
  376. "沈阳":[123.38,41.8],
  377. "苏州":[120.62,31.32],
  378. "茂名":[110.88,21.68],
  379. "嘉兴":[120.76,30.77],
  380. "长春":[125.35,43.88],
  381. "胶州":[120.03336,36.264622],
  382. "银川":[106.27,38.47],
  383. "张家港":[120.555821,31.875428],
  384. "三门峡":[111.19,34.76],
  385. "锦州":[121.15,41.13],
  386. "南昌":[115.89,28.68],
  387. "柳州":[109.4,24.33],
  388. "三亚":[109.511909,18.252847],
  389. "自贡":[104.778442,29.33903],
  390. "吉林":[126.57,43.87],
  391. "阳江":[111.95,21.85],
  392. "泸州":[105.39,28.91],
  393. "西宁":[101.74,36.56],
  394. "宜宾":[104.56,29.77],
  395. "呼和浩特":[111.65,40.82],
  396. "成都":[104.06,30.67],
  397. "大同":[113.3,40.12],
  398. "镇江":[119.44,32.2],
  399. "桂林":[110.28,25.29],
  400. "张家界":[110.479191,29.117096],
  401. "宜兴":[119.82,31.36],
  402. "北海":[109.12,21.49],
  403. "西安":[108.95,34.27],
  404. "金坛":[119.56,31.74],
  405. "东营":[118.49,37.46],
  406. "牡丹江":[129.58,44.6],
  407. "遵义":[106.9,27.7],
  408. "绍兴":[120.58,30.01],
  409. "扬州":[119.42,32.39],
  410. "常州":[119.95,31.79],
  411. "潍坊":[119.1,36.62],
  412. "重庆":[106.54,29.59],
  413. "台州":[121.420757,28.656386],
  414. "南京":[118.78,32.04],
  415. "滨州":[118.03,37.36],
  416. "贵阳":[106.71,26.57],
  417. "无锡":[120.29,31.59],
  418. "本溪":[123.73,41.3],
  419. "克拉玛依":[84.77,45.59],
  420. "渭南":[109.5,34.52],
  421. "马鞍山":[118.48,31.56],
  422. "宝鸡":[107.15,34.38],
  423. "焦作":[113.21,35.24],
  424. "句容":[119.16,31.95],
  425. "北京":[116.46,39.92],
  426. "徐州":[117.2,34.26],
  427. "衡水":[115.72,37.72],
  428. "包头":[110,40.58],
  429. "绵阳":[104.73,31.48],
  430. "乌鲁木齐":[87.68,43.77],
  431. "枣庄":[117.57,34.86],
  432. "杭州":[120.19,30.26],
  433. "淄博":[118.05,36.78],
  434. "鞍山":[122.85,41.12],
  435. "溧阳":[119.48,31.43],
  436. "库尔勒":[86.06,41.68],
  437. "安阳":[114.35,36.1],
  438. "开封":[114.35,34.79],
  439. "济南":[117,36.65],
  440. "德阳":[104.37,31.13],
  441. "温州":[120.65,28.01],
  442. "九江":[115.97,29.71],
  443. "邯郸":[114.47,36.6],
  444. "临安":[119.72,30.23],
  445. "兰州":[103.73,36.03],
  446. "沧州":[116.83,38.33],
  447. "临沂":[118.35,35.05],
  448. "南充":[106.110698,30.837793],
  449. "天津":[117.2,39.13],
  450. "富阳":[119.95,30.07],
  451. "泰安":[117.13,36.18],
  452. "诸暨":[120.23,29.71],
  453. "郑州":[113.65,34.76],
  454. "哈尔滨":[126.63,45.75],
  455. "聊城":[115.97,36.45],
  456. "芜湖":[118.38,31.33],
  457. "唐山":[118.02,39.63],
  458. "平顶山":[113.29,33.75],
  459. "邢台":[114.48,37.05],
  460. "德州":[116.29,37.45],
  461. "济宁":[116.59,35.38],
  462. "荆州":[112.239741,30.335165],
  463. "宜昌":[111.3,30.7],
  464. "义乌":[120.06,29.32],
  465. "丽水":[119.92,28.45],
  466. "洛阳":[112.44,34.7],
  467. "秦皇岛":[119.57,39.95],
  468. "株洲":[113.16,27.83],
  469. "石家庄":[114.48,38.03],
  470. "莱芜":[117.67,36.19],
  471. "常德":[111.69,29.05],
  472. "保定":[115.48,38.85],
  473. "湘潭":[112.91,27.87],
  474. "金华":[119.64,29.12],
  475. "岳阳":[113.09,29.37],
  476. "长沙":[113,28.21],
  477. "衢州":[118.88,28.97],
  478. "廊坊":[116.7,39.53],
  479. "菏泽":[115.480656,35.23375],
  480. "合肥":[117.27,31.86],
  481. "武汉":[114.31,30.52],
  482. "大庆":[125.03,46.58]
  483. }
  484. },
  485. {
  486. name: 'Top5',
  487. type: 'map',
  488. mapType: 'china',
  489. data:[],
  490. markPoint : {
  491. symbol:'emptyCircle',
  492. symbolSize : function (v){
  493. return 10 + v/100
  494. },
  495. effect : {
  496. show: true,
  497. shadowBlur : 0
  498. },
  499. itemStyle:{
  500. normal:{
  501. label:{show:false}
  502. }
  503. },
  504. data : [
  505. {name: "廊坊", value: 193},
  506. {name: "菏泽", value: 194},
  507. {name: "合肥", value: 229},
  508. {name: "武汉", value: 273},
  509. {name: "大庆", value: 279}
  510. ]
  511. }
  512. }
  513. ]
  514. };
  515. </textarea>
  516. </div><!--/.well -->
  517. </div><!--/span-->
  518. <div id="graphic" class="col-md-8">
  519. <div id="main" class="main" style="height: 530px;"></div>
  520. <div>
  521. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  522. <span class="text-primary">切换主题</span>
  523. <select id="theme-select"></select>
  524. <span id='wrong-message' style="color:red"></span>
  525. </div>
  526. </div><!--/span-->
  527. </div><!--/row-->
  528. </div><!--/.fluid-container-->
  529. <footer id="footer"></footer>
  530. <!-- Le javascript
  531. ================================================== -->
  532. <!-- Placed at the end of the document so the pages load faster -->
  533. <script src="../asset/js/jquery.min.js"></script>
  534. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  535. <script src="../asset/js/bootstrap.min.js"></script>
  536. <script src="../asset/js/echartsExample.js"></script>
  537. </body>
  538. </html>