ie11.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <!DOCTYPE>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <script src="lib/esl.js"></script>
  6. <script src="lib/config.js"></script>
  7. <script src="lib/jquery.min.js"></script>
  8. <script src="lib/facePrint.js"></script>
  9. <script src="ut/lib/canteen.js"></script>
  10. <script src="lib/testHelper.js"></script>
  11. <meta name="viewport" content="width=device-width, initial-scale=1" />
  12. <link rel="stylesheet" href="lib/reset.css">
  13. </head>
  14. <body>
  15. <style>
  16. h1 {
  17. line-height: 60px;
  18. height: 60px;
  19. background: #146402;
  20. text-align: center;
  21. font-weight: bold;
  22. color: #eee;
  23. font-size: 14px;
  24. }
  25. .chart {
  26. height: 500px;
  27. }
  28. </style>
  29. <div class="chart" id="main"></div>
  30. <textarea id="info" style="height: 600px; width: 1000px"></textarea>
  31. <script>
  32. var echarts;
  33. var chart;
  34. var myChart;
  35. var groupCategories = [];
  36. var groupColors = [];
  37. require([
  38. 'echarts'
  39. // 'echarts/chart/line',
  40. // 'echarts/chart/bar',
  41. // 'echarts/chart/pie',
  42. // 'echarts/chart/scatter',
  43. // 'echarts/chart/map',
  44. // 'echarts/chart/parallel',
  45. // 'echarts/chart/radar',
  46. // 'echarts/component/grid',
  47. // 'echarts/component/polar',
  48. // 'echarts/component/geo',
  49. // 'echarts/component/singleAxis',
  50. // 'echarts/component/legend',
  51. // 'echarts/component/tooltip',
  52. // 'echarts/component/toolbox',
  53. // 'echarts/component/visualMap',
  54. // 'echarts/component/dataZoom'
  55. ], function (ec) {
  56. echarts = ec;
  57. var y1Max = 100;
  58. var y2Max = 100;
  59. var myxAxisData = ['05-11','05-12','05-13','05-14','05-15','05-16','05-17'];
  60. var myData1 = [28,25,27,26,33,33,33];
  61. var myData2 = [82,71,79,84,99,89,89];
  62. option = {
  63. title: {
  64. text: '最近一周趋势',
  65. textStyle: {
  66. fontWeight: 'bold',
  67. fontSize: 12
  68. },
  69. padding: [15, 0, 0, 0]
  70. },
  71. legend: {
  72. data: ['数量', '比例'],
  73. right: 0,
  74. padding: [15, 0, 0, 0]
  75. },
  76. xAxis: {
  77. data: myxAxisData,
  78. axisLabel: {
  79. textStyle: {
  80. color: '#000'
  81. }
  82. },
  83. axisTick: {
  84. show: true
  85. },
  86. axisLine: {
  87. show: true
  88. },
  89. z: 10
  90. },
  91. yAxis: [{
  92. type: 'value',
  93. name: '数量',
  94. min: 0,
  95. max: y1Max,
  96. position: 'left',
  97. splitLine: {
  98. show: false
  99. }
  100. }, {
  101. type: 'value',
  102. name: '比例',
  103. min: 0,
  104. max: y2Max,
  105. position: 'right',
  106. axisLabel: {
  107. formatter: '{value}%'
  108. },
  109. offset: -6,
  110. splitLine: {
  111. show: false
  112. }
  113. }],
  114. series: [{
  115. name: '数量',
  116. type: 'bar',
  117. barWidth: 18,
  118. yAxisIndex: 0,
  119. label: {
  120. normal: {
  121. color: '#73cafd',
  122. show: true,
  123. position: 'top'
  124. }
  125. },
  126. itemStyle: {
  127. normal: {
  128. color: '#73cafd'
  129. }
  130. },
  131. data: myData1
  132. }, {
  133. name: '比例',
  134. type: 'line',
  135. yAxisIndex: 1,
  136. label: {
  137. normal: {
  138. textStyle: {
  139. color: '#999',
  140. },
  141. show: true,
  142. position: 'top',
  143. formatter: '{c}%'
  144. }
  145. },
  146. lineStyle: {
  147. normal: {
  148. color: '#999',
  149. width: 3,
  150. shadowColor: 'rgba(0,0,0,0.4)',
  151. shadowBlur: 10,
  152. shadowOffsetY: 10
  153. }
  154. },
  155. data: myData2
  156. }]
  157. }
  158. // var canvas = document.createElement('canvas');
  159. // canvas.width = 600;
  160. // canvas.height = 400;
  161. // chart = myChart = echarts.init(canvas);
  162. chart = myChart = echarts.init(document.getElementById('main'));
  163. chart.setOption(option);
  164. // var ctx = canvas.getContext('2d');
  165. // console.log(JSON.stringify(ctx.stack()));
  166. });
  167. </script>
  168. </body>
  169. </html>