bar6.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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: 'From ExcelHome',
  39. sublink: 'http://e.weibo.com/1341556070/Aj1J2x5a5'
  40. },
  41. tooltip : {
  42. trigger: 'axis',
  43. axisPointer : { // 坐标轴指示器,坐标轴触发有效
  44. type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  45. },
  46. formatter: function (params) {
  47. var tar;
  48. if (params[1].value != '-') {
  49. tar = params[1];
  50. }
  51. else {
  52. tar = params[0];
  53. }
  54. return tar.name + '<br/>' + tar.seriesName + ' : ' + tar.value;
  55. }
  56. },
  57. legend: {
  58. data:['支出','收入']
  59. },
  60. toolbox: {
  61. show : true,
  62. feature : {
  63. mark : {show: true},
  64. dataView : {show: true, readOnly: false},
  65. restore : {show: true},
  66. saveAsImage : {show: true}
  67. }
  68. },
  69. xAxis : [
  70. {
  71. type : 'category',
  72. splitLine: {show:false},
  73. data : function (){
  74. var list = [];
  75. for (var i = 1; i <= 11; i++) {
  76. list.push('11月' + i + '日');
  77. }
  78. return list;
  79. }()
  80. }
  81. ],
  82. yAxis : [
  83. {
  84. type : 'value'
  85. }
  86. ],
  87. series : [
  88. {
  89. name:'辅助',
  90. type:'bar',
  91. stack: '总量',
  92. itemStyle:{
  93. normal:{
  94. barBorderColor:'rgba(0,0,0,0)',
  95. color:'rgba(0,0,0,0)'
  96. },
  97. emphasis:{
  98. barBorderColor:'rgba(0,0,0,0)',
  99. color:'rgba(0,0,0,0)'
  100. }
  101. },
  102. data:[0, 900, 1245, 1530, 1376, 1376, 1511, 1689, 1856, 1495, 1292]
  103. },
  104. {
  105. name:'收入',
  106. type:'bar',
  107. stack: '总量',
  108. itemStyle : { normal: {label : {show: true, position: 'top'}}},
  109. data:[900, 345, 393, '-', '-', 135, 178, 286, '-', '-', '-']
  110. },
  111. {
  112. name:'支出',
  113. type:'bar',
  114. stack: '总量',
  115. itemStyle : { normal: {label : {show: true, position: 'bottom'}}},
  116. data:['-', '-', '-', 108, 154, '-', '-', '-', 119, 361, 203]
  117. }
  118. ]
  119. };
  120. </textarea>
  121. </div><!--/.well -->
  122. </div><!--/span-->
  123. <div id="graphic" class="col-md-8">
  124. <div id="main" class="main"></div>
  125. <div>
  126. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  127. <span class="text-primary">切换主题</span>
  128. <select id="theme-select"></select>
  129. <span id='wrong-message' style="color:red"></span>
  130. </div>
  131. </div><!--/span-->
  132. </div><!--/row-->
  133. </div><!--/.fluid-container-->
  134. <footer id="footer"></footer>
  135. <!-- Le javascript
  136. ================================================== -->
  137. <!-- Placed at the end of the document so the pages load faster -->
  138. <script src="../asset/js/jquery.min.js"></script>
  139. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  140. <script src="../asset/js/bootstrap.min.js"></script>
  141. <script src="../asset/js/echartsExample.js"></script>
  142. </body>
  143. </html>