funnel2.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. option = {
  36. color : [
  37. 'rgba(255, 69, 0, 0.5)',
  38. 'rgba(255, 150, 0, 0.5)',
  39. 'rgba(255, 200, 0, 0.5)',
  40. 'rgba(155, 200, 50, 0.5)',
  41. 'rgba(55, 200, 100, 0.5)'
  42. ],
  43. title : {
  44. text: '漏斗图',
  45. subtext: '纯属虚构'
  46. },
  47. tooltip : {
  48. trigger: 'item',
  49. formatter: "{a} <br/>{b} : {c}%"
  50. },
  51. toolbox: {
  52. show : true,
  53. feature : {
  54. mark : {show: true},
  55. dataView : {show: true, readOnly: false},
  56. restore : {show: true},
  57. saveAsImage : {show: true}
  58. }
  59. },
  60. legend: {
  61. data : ['展现','点击','访问','咨询','订单']
  62. },
  63. calculable : true,
  64. series : [
  65. {
  66. name:'预期',
  67. type:'funnel',
  68. x: '10%',
  69. width: '80%',
  70. itemStyle: {
  71. normal: {
  72. label: {
  73. formatter: '{b}预期'
  74. },
  75. labelLine: {
  76. show : false
  77. }
  78. },
  79. emphasis: {
  80. label: {
  81. position:'inside',
  82. formatter: '{b}预期 : {c}%'
  83. }
  84. }
  85. },
  86. data:[
  87. {value:60, name:'访问'},
  88. {value:40, name:'咨询'},
  89. {value:20, name:'订单'},
  90. {value:80, name:'点击'},
  91. {value:100, name:'展现'}
  92. ]
  93. },
  94. {
  95. name:'实际',
  96. type:'funnel',
  97. x: '10%',
  98. width: '80%',
  99. maxSize: '80%',
  100. itemStyle: {
  101. normal: {
  102. borderColor: '#fff',
  103. borderWidth: 2,
  104. label: {
  105. position: 'inside',
  106. formatter: '{c}%',
  107. textStyle: {
  108. color: '#fff'
  109. }
  110. }
  111. },
  112. emphasis: {
  113. label: {
  114. position:'inside',
  115. formatter: '{b}实际 : {c}%'
  116. }
  117. }
  118. },
  119. data:[
  120. {value:30, name:'访问'},
  121. {value:10, name:'咨询'},
  122. {value:5, name:'订单'},
  123. {value:50, name:'点击'},
  124. {value:80, name:'展现'}
  125. ]
  126. }
  127. ]
  128. };
  129. </textarea>
  130. </div><!--/.well -->
  131. </div><!--/span-->
  132. <div id="graphic" class="col-md-8">
  133. <div id="main" class="main"></div>
  134. <div>
  135. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  136. <span class="text-primary">切换主题</span>
  137. <select id="theme-select"></select>
  138. <span id='wrong-message' style="color:red"></span>
  139. </div>
  140. </div><!--/span-->
  141. </div><!--/row-->
  142. </div><!--/.fluid-container-->
  143. <footer id="footer"></footer>
  144. <!-- Le javascript
  145. ================================================== -->
  146. <!-- Placed at the end of the document so the pages load faster -->
  147. <script src="../asset/js/jquery.min.js"></script>
  148. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  149. <script src="../asset/js/bootstrap.min.js"></script>
  150. <script src="../asset/js/echartsExample.js"></script>
  151. </body>
  152. </html>