map16.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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.bodyMale = {
  42. getGeoJson: function (callback) {
  43. $.ajax({
  44. url: "svg/body-male.svg",
  45. dataType: 'xml',
  46. success: function(xml) {
  47. callback(xml)
  48. }
  49. });
  50. }
  51. }
  52. require('echarts/util/mapData/params').params.bodyFemale = {
  53. getGeoJson: function (callback) {
  54. $.ajax({
  55. url: "svg/body-female.svg",
  56. dataType: 'xml',
  57. success: function(xml) {
  58. callback(xml)
  59. }
  60. });
  61. }
  62. }
  63. option = {
  64. title : {
  65. text : '人体密码',
  66. subtext: '地图SVG扩展',
  67. x:'center'
  68. },
  69. tooltip : {
  70. trigger: 'item'
  71. },
  72. toolbox: {
  73. show : true,
  74. orient : 'vertical',
  75. x: 'right',
  76. y: 'center',
  77. feature : {
  78. mark : {show: true},
  79. dataView : {show: true, readOnly: false},
  80. restore : {show: true},
  81. saveAsImage : {show: true}
  82. }
  83. },
  84. dataRange: {
  85. min: 0,
  86. max: 100,
  87. x: 'center',
  88. y: 'center',
  89. tdext:['High','Low'],
  90. calculable : true,
  91. itemHeight:30,
  92. color: ['orangered','yellow','lightskyblue']
  93. },
  94. series : [
  95. {
  96. name: '人体密码-男',
  97. type: 'map',
  98. mapType: 'bodyMale', // 自定义扩展图表类型
  99. mapLocation: {
  100. x:'left'
  101. },
  102. roam:true,
  103. itemStyle:{
  104. normal:{label:{show:true}},
  105. emphasis:{label:{show:true}}
  106. },
  107. data:[
  108. {name: '头部', value: 90},
  109. {name: '颈部', value: 80},
  110. {name: '胸部', value: 60},
  111. {name: '腹部', value: 60},
  112. {name: '生殖', value: 50},
  113. {name: '上肢', value: 40},
  114. {name: '下肢', value: 30}
  115. ],
  116. textFixed : {
  117. '上肢' : [-60, 0]
  118. },
  119. markPoint : {
  120. symbol:'emptyCircle',
  121. symbolSize : 10,
  122. effect : {
  123. show: true
  124. },
  125. data : [
  126. {name: '心脏', value: 100, geoCoord:[138, 126]}
  127. ]
  128. },
  129. markLine : {
  130. smooth:true,
  131. effect : {
  132. show: true,
  133. scaleSize: 1,
  134. period: 30,
  135. color: '#fff',
  136. shadowBlur: 5
  137. },
  138. itemStyle : {
  139. normal: {
  140. borderWidth:1,
  141. lineStyle: {
  142. type: 'solid'
  143. }
  144. }
  145. },
  146. data : [
  147. [
  148. {name:'男',geoCoord:[138, 126]},
  149. {name:'女',value:90,geoCoord:[268, 56]}
  150. ]
  151. ]
  152. }
  153. },
  154. {
  155. name: '人体密码-女',
  156. type: 'map',
  157. mapType: 'bodyFemale', // 自定义扩展图表类型
  158. mapLocation: {
  159. x:'right'
  160. },
  161. roam:true,
  162. itemStyle:{
  163. normal:{label:{show:true}},
  164. emphasis:{label:{show:true}}
  165. },
  166. data:[
  167. {name: '头部', value: 90},
  168. {name: '颈部', value: 80},
  169. {name: '胸部', value: 70},
  170. {name: '腹部', value: 60},
  171. {name: '生殖', value: 50},
  172. {name: '上肢', value: 40},
  173. {name: '下肢', value: 30}
  174. ],
  175. markPoint : {
  176. symbol:'emptyCircle',
  177. symbolSize : 10,
  178. effect : {
  179. show: true
  180. },
  181. data : [
  182. {name: '心脏', value: 100, geoCoord:[118, 126]}
  183. ]
  184. },
  185. markLine : {
  186. smooth:true,
  187. effect : {
  188. show: true,
  189. scaleSize: 1,
  190. period: 30,
  191. color: '#fff',
  192. shadowBlur: 5
  193. },
  194. itemStyle : {
  195. normal: {
  196. borderWidth:1,
  197. lineStyle: {
  198. type: 'solid'
  199. }
  200. }
  201. },
  202. data : [
  203. [
  204. {name:'女',geoCoord:[118, 126]},
  205. {name:'男',value:90,geoCoord:[-22, 56]}
  206. ]
  207. ]
  208. }
  209. }
  210. ]
  211. };
  212. </textarea>
  213. </div><!--/.well -->
  214. </div><!--/span-->
  215. <div id="graphic" class="col-md-8">
  216. <div id="main" class="main" style="height: 530px;"></div>
  217. <div>
  218. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  219. <span class="text-primary">切换主题</span>
  220. <select id="theme-select"></select>
  221. <span id='wrong-message' style="color:red"></span>
  222. </div>
  223. </div><!--/span-->
  224. </div><!--/row-->
  225. </div><!--/.fluid-container-->
  226. <footer id="footer"></footer>
  227. <!-- Le javascript
  228. ================================================== -->
  229. <!-- Placed at the end of the document so the pages load faster -->
  230. <script src="../asset/js/jquery.min.js"></script>
  231. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  232. <script src="../asset/js/bootstrap.min.js"></script>
  233. <script src="../asset/js/echartsExample.js"></script>
  234. </body>
  235. </html>