line.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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. tooltip : {
  37. trigger: 'axis'
  38. },
  39. legend: {
  40. data:['邮件营销','联盟广告','直接访问','搜索引擎']
  41. },
  42. toolbox: {
  43. show : true,
  44. feature : {
  45. mark : {show: true},
  46. dataView : {show: true, readOnly: false},
  47. magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
  48. restore : {show: true},
  49. saveAsImage : {show: true}
  50. }
  51. },
  52. calculable : true,
  53. xAxis : [
  54. {
  55. type : 'category',
  56. boundaryGap : false,
  57. data : ['周一','周二','周三','周四','周五','周六','周日']
  58. }
  59. ],
  60. yAxis : [
  61. {
  62. type : 'value'
  63. }
  64. ],
  65. series : [
  66. {
  67. name:'邮件营销',
  68. type:'line',
  69. stack: '总量',
  70. symbol: 'none',
  71. itemStyle: {
  72. normal: {
  73. areaStyle: {
  74. // 区域图,纵向渐变填充
  75. color : (function (){
  76. var zrColor = require('zrender/tool/color');
  77. return zrColor.getLinearGradient(
  78. 0, 200, 0, 400,
  79. [[0, 'rgba(255,0,0,0.8)'],[0.8, 'rgba(255,255,255,0.1)']]
  80. )
  81. })()
  82. }
  83. }
  84. },
  85. data:[
  86. 120, 132, 301, 134,
  87. {value:90, symbol:'droplet',symbolSize:5},
  88. 230, 210
  89. ]
  90. },
  91. {
  92. name:'联盟广告',
  93. type:'line',
  94. stack: '总量',
  95. smooth: true,
  96. symbol: 'image://../asset/ico/favicon.png', // 系列级个性化拐点图形
  97. symbolSize: 8,
  98. data:[
  99. 120, 82,
  100. {
  101. value:201,
  102. symbol: 'star', // 数据级个性化拐点图形
  103. symbolSize : 15,
  104. itemStyle : { normal: {label : {
  105. show: true,
  106. textStyle : {
  107. fontSize : '20',
  108. fontFamily : '微软雅黑',
  109. fontWeight : 'bold'
  110. }
  111. }}}
  112. },
  113. {
  114. value:134,
  115. symbol: 'none'
  116. },
  117. 190,
  118. {
  119. value : 230,
  120. symbol: 'emptypin',
  121. symbolSize: 8
  122. },
  123. 110
  124. ]
  125. },
  126. {
  127. name:'直接访问',
  128. type:'line',
  129. stack: '总量',
  130. symbol: 'arrow',
  131. symbolSize: 6,
  132. symbolRotate: -45,
  133. itemStyle: {
  134. normal: {
  135. color: 'red',
  136. lineStyle: { // 系列级个性化折线样式
  137. width: 2,
  138. type: 'dashed'
  139. }
  140. },
  141. emphasis: {
  142. color: 'blue'
  143. }
  144. },
  145. data:[
  146. 320, 332, '-', 334,
  147. {
  148. value: 390,
  149. symbol: 'star6',
  150. symbolSize : 20,
  151. symbolRotate : 10,
  152. itemStyle: { // 数据级个性化折线样式
  153. normal: {
  154. color: 'yellowgreen'
  155. },
  156. emphasis: {
  157. color: 'orange',
  158. label : {
  159. show: true,
  160. position: 'inside',
  161. textStyle : {
  162. fontSize : '20'
  163. }
  164. }
  165. }
  166. }
  167. },
  168. 330, 320
  169. ]
  170. },
  171. {
  172. name:'搜索引擎',
  173. type:'line',
  174. symbol:'emptyCircle',
  175. itemStyle: {
  176. normal: {
  177. lineStyle: { // 系列级个性化折线样式,横向渐变描边
  178. width: 2,
  179. color: (function (){
  180. var zrColor = require('zrender/tool/color');
  181. return zrColor.getLinearGradient(
  182. 0, 0, 1000, 0,
  183. [[0, 'rgba(255,0,0,0.8)'],[0.8, 'rgba(255,255,0,0.8)']]
  184. )
  185. })(),
  186. shadowColor : 'rgba(0,0,0,0.5)',
  187. shadowBlur: 10,
  188. shadowOffsetX: 8,
  189. shadowOffsetY: 8
  190. }
  191. },
  192. emphasis : {
  193. label : {show: true}
  194. }
  195. },
  196. data:[
  197. 620, 732, 791,
  198. {value:734, symbol:'emptyHeart',symbolSize:10},
  199. 890, 930, 820
  200. ]
  201. }
  202. ]
  203. };
  204. </textarea>
  205. </div><!--/.well -->
  206. </div><!--/span-->
  207. <div id="graphic" class="col-md-8">
  208. <div id="main" class="main"></div>
  209. <div>
  210. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  211. <span class="text-primary">切换主题</span>
  212. <select id="theme-select"></select>
  213. <span id='wrong-message' style="color:red"></span>
  214. </div>
  215. </div><!--/span-->
  216. </div><!--/row-->
  217. </div><!--/.fluid-container-->
  218. <footer id="footer"></footer>
  219. <!-- Le javascript
  220. ================================================== -->
  221. <!-- Placed at the end of the document so the pages load faster -->
  222. <script src="../asset/js/jquery.min.js"></script>
  223. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  224. <script src="../asset/js/bootstrap.min.js"></script>
  225. <script src="../asset/js/echartsExample.js"></script>
  226. </body>
  227. </html>