map18.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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. // 自定义扩展图表类型:mapType = body
  41. require('echarts/util/mapData/params').params.baiduBuilding = {
  42. getGeoJson: function (callback) {
  43. $.ajax({
  44. url: "svg/baidu-building.svg",
  45. dataType: 'xml',
  46. success: function(xml) {
  47. callback(xml)
  48. }
  49. });
  50. }
  51. }
  52. option = {
  53. backgroundColor:'#eee',
  54. title : {
  55. text : '百度大厦',
  56. textStyle: {
  57. color: '#000'
  58. }
  59. },
  60. tooltip : {
  61. trigger: 'item',
  62. formatter: '{b}'
  63. },
  64. color: ['rgba(218, 70, 214, 1)', 'rgba(100, 149, 237, 1)', 'green'],
  65. legend: {
  66. data: ['嘿嘿', '高经', '会议室']
  67. },
  68. toolbox: {
  69. show : true,
  70. feature : {
  71. mark : {show: true},
  72. dataView : {show: true, readOnly: false},
  73. restore : {show: true},
  74. saveAsImage : {show: true}
  75. }
  76. },
  77. series : [
  78. {
  79. name: '嘿嘿',
  80. type: 'map',
  81. mapType: 'baiduBuilding',
  82. roam:true,
  83. itemStyle:{
  84. normal:{label:{show:true}},
  85. emphasis:{label:{show:true}}
  86. },
  87. data: [],
  88. geoCoord: {
  89. '叮叮': [39, 45],
  90. '小兑儿': [71, 45],
  91. '胡瑶': [195, 29],
  92. '祖明': [195, 44],
  93. '林峰': [195, 60],
  94. '安晨': [210, 44],
  95. '功': [210, 60],
  96. '立新': [144, 59],
  97. '诗才': [195, 71],
  98. '黄競': [210, 59],
  99. '浪宇': [150, 55],
  100. '晓青': [210, 71],
  101. '毅楠': [222, 59],
  102. '朝霞': [222, 71],
  103. '武琦': [231, 71],
  104. '严萍': [231, 46],
  105. '绍波': [231, 59],
  106. '开放': [488, 43],
  107. '兵兵': [488, 60],
  108. '孟珂': [522, 43],
  109. '辉耀': [522, 60],
  110. '佳璐': [488, 23],
  111. '新乐': [522, 23],
  112. '大佛': [165, 29],
  113. '周玉': [165, 44],
  114. '令君': [165, 60],
  115. '佳璐': [165, 71],
  116. 'erik': [222, 44],
  117. '爽哥': [240, 60],
  118. '雷哥': [240, 44],
  119. '坤哥': [176, 59],
  120. '刚哥': [176, 71],
  121. '高经': [545, 54],
  122. '邱华': [468, 23],
  123. '饥渴难耐的辉辉': [473, 40],
  124. '大发': [500, 40],
  125. '淼童': [473, 60],
  126. '亚江': [500, 60],
  127. '莉姐': [530, 70],
  128. '红启': [570, 54],
  129. '五福降中天': [373, 173],
  130. 'csfe': [500, 54],
  131. '得胜令': [253, 179],
  132. '西湖春': [496, 179],
  133. '望江南': [72, 203],
  134. '庆千秋': [86, 203],
  135. '过江龙': [289, 32],
  136. '天下乐': [289, 50],
  137. '万年欢': [687, 24],
  138. '浣溪沙': [637, 203],
  139. '清平乐': [649, 203],
  140. '四和春': [663, 203],
  141. '杏花天': [676, 203]
  142. },
  143. markPoint : {
  144. symbolSize : 3,
  145. data : [
  146. {name: '叮叮'},
  147. {name: '小兑儿'},
  148. {name: '胡瑶'},
  149. {name: '高经'},
  150. {name: 'erik'},
  151. {name: '祖明'},
  152. {name: '林峰'},
  153. {name: '坤哥'},
  154. {name: '刚哥'},
  155. {name: '爽哥'},
  156. {name: '雷哥'},
  157. {name: '邱华'},
  158. {name: '淼童'},
  159. {name: '亚江'},
  160. {name: '莉姐'},
  161. {name: '大发'},
  162. {name: '饥渴难耐的辉辉'},
  163. {name: '红启'},
  164. {name: '安晨'},
  165. {name: '功'},
  166. {name: '立新'},
  167. {name: '诗才'},
  168. {name: '黄競'},
  169. {name: '晓青'},
  170. {name: '毅楠'},
  171. {name: '浪宇'},
  172. {name: '朝霞'},
  173. {name: '严萍'},
  174. {name: '武琦'},
  175. {name: '绍波'},
  176. {name: '开放'},
  177. {name: '兵兵'},
  178. {name: '孟珂'},
  179. {name: '辉耀'},
  180. {name: '佳璐'},
  181. {name: '新乐'},
  182. {name: '周玉'},
  183. {name: '令君'},
  184. {name: '佳璐'}
  185. ]
  186. },
  187. markLine : {
  188. smooth:true,
  189. effect : {
  190. show: true,
  191. scaleSize: 1,
  192. period: 20,
  193. color: '#fff',
  194. shadowBlur: 5
  195. },
  196. symbol: ['none'],
  197. itemStyle : {
  198. normal: {
  199. borderWidth:1,
  200. lineStyle: {
  201. type: 'solid'
  202. }
  203. }
  204. },
  205. data : [
  206. [
  207. {name:'erik'},
  208. {name:'胡瑶'}
  209. ],
  210. [
  211. {name:'祖明'},
  212. {name:'叮叮'}
  213. ],
  214. [
  215. {name:'祖明'},
  216. {name:'小兑儿'}
  217. ]
  218. ]
  219. }
  220. },
  221. {
  222. name: '高经',
  223. type: 'map',
  224. mapType: 'baiduBuilding',
  225. roam:true,
  226. symbol: ['none'],
  227. itemStyle:{
  228. normal:{label:{show:true}},
  229. emphasis:{label:{show:true}}
  230. },
  231. data: [],
  232. markLine : {
  233. smooth:true,
  234. effect : {
  235. show: true,
  236. scaleSize: 1,
  237. period: 20,
  238. color: '#fff',
  239. shadowBlur: 5
  240. },
  241. itemStyle : {
  242. normal: {
  243. borderWidth:1,
  244. lineStyle: {
  245. type: 'solid'
  246. }
  247. }
  248. },
  249. data : [
  250. [
  251. {name:'高经'},
  252. {name:'洗手间', geoCoord:[440, 179]}
  253. ],
  254. [
  255. {name:'高经'},
  256. {name:'洗手间', geoCoord:[637, 53]}
  257. ],
  258. [
  259. {name:'高经'},
  260. {name:'洗手间', geoCoord:[637, 179]}
  261. ],
  262. [
  263. {name:'高经'},
  264. {name:'洗手间', geoCoord:[307, 179]}
  265. ]
  266. ]
  267. }
  268. },
  269. {
  270. name: '会议室',
  271. type: 'map',
  272. mapType: 'baiduBuilding',
  273. roam:true,
  274. itemStyle:{
  275. normal:{label:{show:true}},
  276. emphasis:{label:{show:true}}
  277. },
  278. data:[],
  279. markPoint : {
  280. symbol:'circle',
  281. symbolSize : 2,
  282. color: 'green',
  283. data : []
  284. },
  285. markLine : {
  286. smooth:true,
  287. effect : {
  288. show: true,
  289. scaleSize: 1,
  290. period: 20,
  291. color: '#fff',
  292. shadowBlur: 5
  293. },
  294. symbol: ['none'],
  295. itemStyle : {
  296. normal: {
  297. borderWidth:1,
  298. lineStyle: {
  299. type: 'solid'
  300. }
  301. }
  302. },
  303. data : [
  304. [
  305. {name:'淼童'},
  306. {name:'五福降中天'}
  307. ],
  308. [
  309. {name:'大发'},
  310. {name:'西湖春'}
  311. ],
  312. [
  313. {name:'林峰'},
  314. {name:'望江南'}
  315. ],
  316. [
  317. {name:'莉姐'},
  318. {name:'杏花天'}
  319. ],
  320. [
  321. {name:'雷哥'},
  322. {name:'过江龙'}
  323. ],
  324. [
  325. {name:'毅楠'},
  326. {name:'天下乐'}
  327. ],
  328. [
  329. {name:'红启'},
  330. {name:'万年欢'}
  331. ],
  332. [
  333. {name:'亚江'},
  334. {name:'浣溪沙'}
  335. ],
  336. [
  337. {name:'爽哥'},
  338. {name:'得胜令'}
  339. ],
  340. [
  341. {name:'饥渴难耐的辉辉'},
  342. {name:'万年欢'}
  343. ]
  344. ]
  345. }
  346. },
  347. {
  348. type: 'map',
  349. mapType: 'baiduBuilding',
  350. data: [],
  351. markPoint: {
  352. symbol: 'emptyCircle',
  353. effect: {
  354. show: true,
  355. color: 'rgba(218, 70, 214, 1)'
  356. },
  357. data: [
  358. {name: '叮叮'},
  359. {name: '小兑儿'},
  360. {name: '胡瑶'},
  361. {name: '淼童'}
  362. ]
  363. }
  364. },
  365. {
  366. type: 'map',
  367. mapType: 'baiduBuilding',
  368. data: [],
  369. markPoint: {
  370. symbol: 'emptyCircle',
  371. effect: {
  372. show: true,
  373. color: 'rgba(100, 149, 237, 1)'
  374. },
  375. data: [
  376. {name: '高经'}
  377. ]
  378. }
  379. },
  380. {
  381. type: 'map',
  382. mapType: 'baiduBuilding',
  383. data: [],
  384. markPoint: {
  385. symbol: 'emptyCircle',
  386. symbolSize : 15,
  387. effect: {
  388. show: true,
  389. color: 'green'
  390. },
  391. data: [
  392. {name: '五福降中天'}
  393. ]
  394. }
  395. }
  396. ]
  397. };
  398. </textarea>
  399. </div><!--/.well -->
  400. </div><!--/span-->
  401. <div id="graphic" class="col-md-8">
  402. <div id="main" class="main" style="height: 530px;"></div>
  403. <div>
  404. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  405. <span class="text-primary">切换主题</span>
  406. <select id="theme-select"></select>
  407. <span id='wrong-message' style="color:red"></span>
  408. </div>
  409. </div><!--/span-->
  410. </div><!--/row-->
  411. </div><!--/.fluid-container-->
  412. <footer id="footer"></footer>
  413. <!-- Le javascript
  414. ================================================== -->
  415. <!-- Placed at the end of the document so the pages load faster -->
  416. <script src="../asset/js/jquery.min.js"></script>
  417. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  418. <script src="../asset/js/bootstrap.min.js"></script>
  419. <script src="../asset/js/echartsExample.js"></script>
  420. </body>
  421. </html>