pie6.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. var dataStyle = {
  36. normal: {
  37. label: {show:false},
  38. labelLine: {show:false}
  39. }
  40. };
  41. var placeHolderStyle = {
  42. normal : {
  43. color: 'rgba(0,0,0,0)',
  44. label: {show:false},
  45. labelLine: {show:false}
  46. },
  47. emphasis : {
  48. color: 'rgba(0,0,0,0)'
  49. }
  50. };
  51. option = {
  52. title: {
  53. text: '你幸福吗?',
  54. subtext: 'From ExcelHome',
  55. sublink: 'http://e.weibo.com/1341556070/AhQXtjbqh',
  56. x: 'center',
  57. y: 'center',
  58. itemGap: 20,
  59. textStyle : {
  60. color : 'rgba(30,144,255,0.8)',
  61. fontFamily : '微软雅黑',
  62. fontSize : 35,
  63. fontWeight : 'bolder'
  64. }
  65. },
  66. tooltip : {
  67. show: true,
  68. formatter: "{a} <br/>{b} : {c} ({d}%)"
  69. },
  70. legend: {
  71. orient : 'vertical',
  72. x : document.getElementById('main').offsetWidth / 2,
  73. y : 45,
  74. itemGap:12,
  75. data:['68%的人表示过的不错','29%的人表示生活压力很大','3%的人表示“我姓曾”']
  76. },
  77. toolbox: {
  78. show : true,
  79. feature : {
  80. mark : {show: true},
  81. dataView : {show: true, readOnly: false},
  82. restore : {show: true},
  83. saveAsImage : {show: true}
  84. }
  85. },
  86. series : [
  87. {
  88. name:'1',
  89. type:'pie',
  90. clockWise:false,
  91. radius : [125, 150],
  92. itemStyle : dataStyle,
  93. data:[
  94. {
  95. value:68,
  96. name:'68%的人表示过的不错'
  97. },
  98. {
  99. value:32,
  100. name:'invisible',
  101. itemStyle : placeHolderStyle
  102. }
  103. ]
  104. },
  105. {
  106. name:'2',
  107. type:'pie',
  108. clockWise:false,
  109. radius : [100, 125],
  110. itemStyle : dataStyle,
  111. data:[
  112. {
  113. value:29,
  114. name:'29%的人表示生活压力很大'
  115. },
  116. {
  117. value:71,
  118. name:'invisible',
  119. itemStyle : placeHolderStyle
  120. }
  121. ]
  122. },
  123. {
  124. name:'3',
  125. type:'pie',
  126. clockWise:false,
  127. radius : [75, 100],
  128. itemStyle : dataStyle,
  129. data:[
  130. {
  131. value:3,
  132. name:'3%的人表示“我姓曾”'
  133. },
  134. {
  135. value:97,
  136. name:'invisible',
  137. itemStyle : placeHolderStyle
  138. }
  139. ]
  140. }
  141. ]
  142. };
  143. </textarea>
  144. </div><!--/.well -->
  145. </div><!--/span-->
  146. <div id="graphic" class="col-md-8">
  147. <div id="main" class="main"></div>
  148. <div>
  149. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  150. <span class="text-primary">切换主题</span>
  151. <select id="theme-select"></select>
  152. <span id='wrong-message' style="color:red"></span>
  153. </div>
  154. </div><!--/span-->
  155. </div><!--/row-->
  156. </div><!--/.fluid-container-->
  157. <footer id="footer"></footer>
  158. <!-- Le javascript
  159. ================================================== -->
  160. <!-- Placed at the end of the document so the pages load faster -->
  161. <script src="../asset/js/jquery.min.js"></script>
  162. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  163. <script src="../asset/js/bootstrap.min.js"></script>
  164. <script src="../asset/js/echartsExample.js"></script>
  165. </body>
  166. </html>