bar8.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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 labelRight = {normal: {label : {position: 'right'}}};
  36. option = {
  37. title: {
  38. text: '交错正负轴标签',
  39. subtext: 'From ExcelHome',
  40. sublink: 'http://e.weibo.com/1341556070/AjwF2AgQm'
  41. },
  42. tooltip : {
  43. trigger: 'axis',
  44. axisPointer : { // 坐标轴指示器,坐标轴触发有效
  45. type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  46. }
  47. },
  48. toolbox: {
  49. show : true,
  50. feature : {
  51. mark : {show: true},
  52. dataView : {show: true, readOnly: false},
  53. magicType : {show: true, type: ['line', 'bar']},
  54. restore : {show: true},
  55. saveAsImage : {show: true}
  56. }
  57. },
  58. grid: {
  59. y: 80,
  60. y2: 30
  61. },
  62. xAxis : [
  63. {
  64. type : 'value',
  65. position: 'top',
  66. splitLine: {lineStyle:{type:'dashed'}},
  67. }
  68. ],
  69. yAxis : [
  70. {
  71. type : 'category',
  72. axisLine: {show: false},
  73. axisLabel: {show: false},
  74. axisTick: {show: false},
  75. splitLine: {show: false},
  76. data : ['ten', 'nine', 'eight', 'seven', 'six', 'five', 'four', 'three', 'two', 'one']
  77. }
  78. ],
  79. series : [
  80. {
  81. name:'生活费',
  82. type:'bar',
  83. stack: '总量',
  84. itemStyle : { normal: {
  85. color: 'orange',
  86. borderRadius: 5,
  87. label : {
  88. show: true,
  89. position: 'left',
  90. formatter: '{b}'
  91. }
  92. }},
  93. data:[
  94. {value:-0.07, itemStyle:labelRight},
  95. {value:-0.09, itemStyle:labelRight},
  96. 0.2, 0.44,
  97. {value:-0.23, itemStyle:labelRight},
  98. 0.08,
  99. {value:-0.17, itemStyle:labelRight},
  100. 0.47,
  101. {value:-0.36, itemStyle:labelRight},
  102. 0.18
  103. ]
  104. }
  105. ]
  106. };
  107. </textarea>
  108. </div><!--/.well -->
  109. </div><!--/span-->
  110. <div id="graphic" class="col-md-8">
  111. <div id="main" class="main"></div>
  112. <div>
  113. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  114. <span class="text-primary">切换主题</span>
  115. <select id="theme-select"></select>
  116. <span id='wrong-message' style="color:red"></span>
  117. </div>
  118. </div><!--/span-->
  119. </div><!--/row-->
  120. </div><!--/.fluid-container-->
  121. <footer id="footer"></footer>
  122. <!-- Le javascript
  123. ================================================== -->
  124. <!-- Placed at the end of the document so the pages load faster -->
  125. <script src="../asset/js/jquery.min.js"></script>
  126. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  127. <script src="../asset/js/bootstrap.min.js"></script>
  128. <script src="../asset/js/echartsExample.js"></script>
  129. </body>
  130. </html>