scatter2.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. </head>
  26. <body>
  27. <!-- Fixed navbar -->
  28. <div class="navbar navbar-default navbar-fixed-top" role="navigation" id="head"></div>
  29. <div class="container-fluid">
  30. <div class="row-fluid example">
  31. <div id="sidebar-code" class="col-md-4">
  32. <div class="well sidebar-nav">
  33. <div class="nav-header"><a href="#" onclick="autoResize()" class="glyphicon glyphicon-resize-full" id ="icon-resize" ></a>option</div>
  34. <textarea id="code" name="code">
  35. function random(){
  36. var r = Math.round(Math.random() * 100);
  37. return (r * (r % 2 == 0 ? 1 : -1));
  38. }
  39. function randomDataArray() {
  40. var d = [];
  41. var len = 100;
  42. while (len--) {
  43. d.push([
  44. random(),
  45. random(),
  46. Math.abs(random()),
  47. ]);
  48. }
  49. return d;
  50. }
  51. option = {
  52. tooltip : {
  53. trigger: 'axis',
  54. showDelay : 0,
  55. axisPointer:{
  56. show: true,
  57. type : 'cross',
  58. lineStyle: {
  59. type : 'dashed',
  60. width : 1
  61. }
  62. }
  63. },
  64. legend: {
  65. data:['scatter1','scatter2']
  66. },
  67. toolbox: {
  68. show : true,
  69. feature : {
  70. mark : {show: true},
  71. dataZoom : {show: true},
  72. dataView : {show: true, readOnly: false},
  73. restore : {show: true},
  74. saveAsImage : {show: true}
  75. }
  76. },
  77. xAxis : [
  78. {
  79. type : 'value',
  80. splitNumber: 4,
  81. scale: true
  82. }
  83. ],
  84. yAxis : [
  85. {
  86. type : 'value',
  87. splitNumber: 4,
  88. scale: true
  89. }
  90. ],
  91. series : [
  92. {
  93. name:'scatter1',
  94. type:'scatter',
  95. symbolSize: function (value){
  96. return Math.round(value[2] / 5);
  97. },
  98. data: randomDataArray()
  99. },
  100. {
  101. name:'scatter2',
  102. type:'scatter',
  103. symbolSize: function (value){
  104. return Math.round(value[2] / 5);
  105. },
  106. data: randomDataArray()
  107. }
  108. ]
  109. };
  110. </textarea>
  111. </div><!--/.well -->
  112. </div><!--/span-->
  113. <div id="graphic" class="col-md-8">
  114. <div id="main" class="main"></div>
  115. <div>
  116. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  117. <span class="text-primary">切换主题</span>
  118. <select id="theme-select"></select>
  119. <span id='wrong-message' style="color:red"></span>
  120. </div>
  121. </div><!--/span-->
  122. </div><!--/row-->
  123. </div><!--/.fluid-container-->
  124. <footer id="footer"></footer>
  125. <!-- Le javascript
  126. ================================================== -->
  127. <!-- Placed at the end of the document so the pages load faster -->
  128. <script src="../asset/js/jquery.min.js"></script>
  129. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  130. <script src="../asset/js/bootstrap.min.js"></script>
  131. <script src="../asset/js/echartsExample.js"></script>
  132. </body>
  133. </html>