lasagna.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. title : {
  37. text: '浏览器占比变化',
  38. subtext: '纯属虚构',
  39. x:'right',
  40. y:'bottom'
  41. },
  42. tooltip : {
  43. trigger: 'item',
  44. formatter: "{a} <br/>{b} : {c} ({d}%)"
  45. },
  46. legend: {
  47. orient : 'vertical',
  48. x : 'left',
  49. data:['Chrome','Firefox','Safari','IE9+','IE8-']
  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. calculable : false,
  61. series : (function (){
  62. var series = [];
  63. for (var i = 0; i < 30; i++) {
  64. series.push({
  65. name:'浏览器(数据纯属虚构)',
  66. type:'pie',
  67. itemStyle : {normal : {
  68. label : {show : i > 28},
  69. labelLine : {show : i > 28, length:20}
  70. }},
  71. radius : [i * 4 + 40, i * 4 + 43],
  72. data:[
  73. {value: i * 128 + 80, name:'Chrome'},
  74. {value: i * 64 + 160, name:'Firefox'},
  75. {value: i * 32 + 320, name:'Safari'},
  76. {value: i * 16 + 640, name:'IE9+'},
  77. {value: i * 8 + 1280, name:'IE8-'}
  78. ]
  79. })
  80. }
  81. series[0].markPoint = {
  82. symbol:'emptyCircle',
  83. symbolSize:series[0].radius[0],
  84. effect:{show:true,scaleSize:12,color:'rgba(250,225,50,0.8)',shadowBlur:10,period:30},
  85. data:[{x:'50%',y:'50%'}]
  86. };
  87. return series;
  88. })()
  89. };
  90. setTimeout(function (){
  91. var _ZR = myChart.getZrender();
  92. var TextShape = require('zrender/shape/Text');
  93. // 补充千层饼
  94. _ZR.addShape(new TextShape({
  95. style : {
  96. x : _ZR.getWidth() / 2,
  97. y : _ZR.getHeight() / 2,
  98. color: '#666',
  99. text : '恶梦的过去',
  100. textAlign : 'center'
  101. }
  102. }));
  103. _ZR.addShape(new TextShape({
  104. style : {
  105. x : _ZR.getWidth() / 2 + 200,
  106. y : _ZR.getHeight() / 2,
  107. brushType:'fill',
  108. color: 'orange',
  109. text : '美好的未来',
  110. textAlign : 'left',
  111. textFont:'normal 20px 微软雅黑'
  112. }
  113. }));
  114. _ZR.refresh();
  115. }, 2000);
  116. </textarea>
  117. </div><!--/.well -->
  118. </div><!--/span-->
  119. <div id="graphic" class="col-md-8">
  120. <div id="main" class="main"></div>
  121. <div>
  122. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  123. <span class="text-primary">切换主题</span>
  124. <select id="theme-select"></select>
  125. <span id='wrong-message' style="color:red"></span>
  126. </div>
  127. </div><!--/span-->
  128. </div><!--/row-->
  129. </div><!--/.fluid-container-->
  130. <footer id="footer"></footer>
  131. <!-- Le javascript
  132. ================================================== -->
  133. <!-- Placed at the end of the document so the pages load faster -->
  134. <script src="../asset/js/jquery.min.js"></script>
  135. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  136. <script src="../asset/js/bootstrap.min.js"></script>
  137. <script src="../asset/js/echartsExample.js"></script>
  138. </body>
  139. </html>