map13.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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 = continent 大洲地图
  41. require('echarts/util/mapData/params').params.continent = {
  42. getGeoJson: function (callback) {
  43. $.getJSON('geoJson/continent_geo.json',callback);
  44. }
  45. }
  46. option = {
  47. title : {
  48. text : '金棕榈 智慧旅行@云数据',
  49. subtext: 'by 江江的喵',
  50. link: 'http://www.palmyou.com/',
  51. sublink: 'http://weibo.com/u/2813464944'
  52. },
  53. tooltip : {
  54. trigger: 'item',
  55. formatter: function (params){
  56. var value = params.value + '万人次 (' + (params.value/98.19).toFixed(2) + '%)';
  57. return params.seriesName + '<br/>' + params.name + ' : ' + value;
  58. }
  59. },
  60. toolbox: {
  61. show : true,
  62. orient : 'vertical',
  63. x: 'right',
  64. y: 'center',
  65. feature : {
  66. mark : {show: true},
  67. dataView : {show: true, readOnly: false},
  68. restore : {show: true},
  69. saveAsImage : {show: true}
  70. }
  71. },
  72. dataRange: {
  73. min: 0,
  74. max: 1000,
  75. text:['热', '冷'],
  76. splitNumber:0,
  77. color: ['orangered','yellow','lightskyblue']
  78. },
  79. series : [
  80. {
  81. name: '2013年出境目的地(洲际统计)',
  82. type: 'map',
  83. mapType: 'continent', // 自定义扩展图表类型
  84. itemStyle:{
  85. normal:{label:{show:true}},
  86. emphasis:{label:{show:true}}
  87. },
  88. data:[
  89. {name: '亚洲', value: 8967.69},
  90. {name: '大洋洲', value: 592.09},
  91. {name: '欧洲', value: 183.62},
  92. {name: '北美洲', value: 41.63},
  93. {name: '南美洲', value: 10.41},
  94. {name: '非洲', value: 22.5837}
  95. ],
  96. // 文本位置修正
  97. textFixed : {
  98. '大洋洲' : [265, 0],
  99. '非洲' : [10, -30],
  100. '北美洲' : [20, 0],
  101. '南美洲' : [0, -10],
  102. '亚洲' : [20, -30],
  103. '欧洲' : [200, -10],
  104. }
  105. }
  106. ]
  107. };
  108. </textarea>
  109. </div><!--/.well -->
  110. </div><!--/span-->
  111. <div id="graphic" class="col-md-8">
  112. <div id="main" class="main" style="height: 530px;"></div>
  113. <div>
  114. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  115. <span class="text-primary">切换主题</span>
  116. <select id="theme-select"></select>
  117. <span id='wrong-message' style="color:red"></span>
  118. </div>
  119. </div><!--/span-->
  120. </div><!--/row-->
  121. </div><!--/.fluid-container-->
  122. <footer id="footer"></footer>
  123. <!-- Le javascript
  124. ================================================== -->
  125. <!-- Placed at the end of the document so the pages load faster -->
  126. <script src="../asset/js/jquery.min.js"></script>
  127. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  128. <script src="../asset/js/bootstrap.min.js"></script>
  129. <script src="../asset/js/echartsExample.js"></script>
  130. </body>
  131. </html>