034860ade4b599342fc1fafcee8972d1bfec9e95.svn-base 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  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="javascript:;" 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. },
  40. tooltip : {
  41. trigger: 'item',
  42. formatter: "{b}: {c}"
  43. },
  44. toolbox: {
  45. show : true,
  46. feature : {
  47. mark : {show: true},
  48. dataView : {show: true, readOnly: false},
  49. restore : {show: true},
  50. saveAsImage : {show: true}
  51. }
  52. },
  53. calculable : false,
  54. series : [
  55. {
  56. name:'树图',
  57. type:'tree',
  58. orient: 'vertical', // vertical horizontal
  59. rootLocation: {x: '25%' ,y: 50}, // 根节点位置 {x: 100, y: 'center'}
  60. nodePadding: 1,
  61. itemStyle: {
  62. normal: {
  63. label: {
  64. show: false,
  65. formatter: "{b}"
  66. },
  67. lineStyle: {
  68. color: '#48b',
  69. shadowColor: '#000',
  70. shadowBlur: 3,
  71. shadowOffsetX: 3,
  72. shadowOffsetY: 5,
  73. type: 'curve' // 'curve'|'broken'|'solid'|'dotted'|'dashed'
  74. }
  75. },
  76. emphasis: {
  77. label: {
  78. show: true
  79. }
  80. }
  81. },
  82. data: [
  83. {
  84. name: '根节点',
  85. value: 6,
  86. children: [
  87. {
  88. name: '节点1',
  89. value: 4,
  90. children: [
  91. {
  92. name: '叶子节点1',
  93. value: 4
  94. },
  95. {
  96. name: '叶子节点2',
  97. value: 4
  98. },
  99. {
  100. name: '叶子节点3',
  101. value: 2
  102. },
  103. {
  104. name: '叶子节点4',
  105. value: 2
  106. },
  107. {
  108. name: '叶子节点5',
  109. value: 2
  110. },
  111. {
  112. name: '叶子节点6',
  113. value: 4
  114. }
  115. ]
  116. },
  117. {
  118. name: '节点2',
  119. value: 4,
  120. children: [{
  121. name: '叶子节点7',
  122. value: 4
  123. },
  124. {
  125. name: '叶子节点8',
  126. value: 4
  127. }]
  128. },
  129. {
  130. name: '节点3',
  131. value: 1,
  132. children: [
  133. {
  134. name: '叶子节点9',
  135. value: 4
  136. },
  137. {
  138. name: '叶子节点10',
  139. value: 4
  140. },
  141. {
  142. name: '叶子节点11',
  143. value: 2
  144. },
  145. {
  146. name: '叶子节点12',
  147. value: 2
  148. }
  149. ]
  150. }
  151. ]
  152. }
  153. ]
  154. },
  155. {
  156. name:'树图',
  157. type:'tree',
  158. orient: 'horizontal', // vertical horizontal
  159. rootLocation: {x: '45%', y: '60%'}, // 根节点位置 {x: 'center',y: 10}
  160. nodePadding: 20,
  161. symbol: 'circle',
  162. symbolSize: 40,
  163. itemStyle: {
  164. normal: {
  165. label: {
  166. show: true,
  167. position: 'inside',
  168. textStyle: {
  169. color: '#cc9999',
  170. fontSize: 15,
  171. fontWeight: 'bolder'
  172. }
  173. },
  174. lineStyle: {
  175. color: '#000',
  176. width: 1,
  177. type: 'broken' // 'curve'|'broken'|'solid'|'dotted'|'dashed'
  178. }
  179. },
  180. emphasis: {
  181. label: {
  182. show: true
  183. }
  184. }
  185. },
  186. data: [
  187. {
  188. name: '手机',
  189. value: 6,
  190. symbolSize: [90, 70],
  191. symbol: 'image://http://www.iconpng.com/png/ecommerce-business/iphone.png',
  192. itemStyle: {
  193. normal: {
  194. label: {
  195. show: false
  196. }
  197. }
  198. },
  199. children: [
  200. {
  201. name: '小米',
  202. value: 4,
  203. symbol: 'image://http://pic.58pic.com/58pic/12/36/51/66d58PICMUV.jpg',
  204. itemStyle: {
  205. normal: {
  206. label: {
  207. show: false
  208. }
  209. }
  210. },
  211. symbolSize: [60, 60],
  212. children: [
  213. {
  214. name: '小米1',
  215. symbol: 'circle',
  216. symbolSize: 20,
  217. value: 4,
  218. itemStyle: {
  219. normal: {
  220. color: '#fa6900',
  221. label: {
  222. show: true,
  223. position: 'right'
  224. },
  225. },
  226. emphasis: {
  227. label: {
  228. show: false
  229. },
  230. borderWidth: 0
  231. }
  232. }
  233. },
  234. {
  235. name: '小米2',
  236. value: 4,
  237. symbol: 'circle',
  238. symbolSize: 20,
  239. itemStyle: {
  240. normal: {
  241. label: {
  242. show: true,
  243. position: 'right',
  244. formatter: "{b}"
  245. },
  246. color: '#fa6900',
  247. borderWidth: 2,
  248. borderColor: '#cc66ff'
  249. },
  250. emphasis: {
  251. borderWidth: 0
  252. }
  253. }
  254. },
  255. {
  256. name: '小米3',
  257. value: 2,
  258. symbol: 'circle',
  259. symbolSize: 20,
  260. itemStyle: {
  261. normal: {
  262. label: {
  263. position: 'right'
  264. },
  265. color: '#fa6900',
  266. brushType: 'stroke',
  267. borderWidth: 1,
  268. borderColor: '#999966',
  269. },
  270. emphasis: {
  271. borderWidth: 0
  272. }
  273. }
  274. }
  275. ]
  276. },
  277. {
  278. name: '苹果',
  279. symbol: 'image://http://www.viastreaming.com/images/apple_logo2.png',
  280. symbolSize: [60, 60],
  281. itemStyle: {
  282. normal: {
  283. label: {
  284. show: false
  285. }
  286. }
  287. },
  288. value: 4
  289. },
  290. {
  291. name: '华为',
  292. symbol: 'image://http://market.huawei.com/hwgg/logo_cn/download/logo.jpg',
  293. symbolSize: [60, 60],
  294. itemStyle: {
  295. normal: {
  296. label: {
  297. show: false
  298. }
  299. }
  300. },
  301. value: 2
  302. },
  303. {
  304. name: '联想',
  305. symbol: 'image://http://www.lenovo.com.cn/HomeUpload/Home001/6d94ee9a20140714.jpg',
  306. symbolSize: [100, 40],
  307. itemStyle: {
  308. normal: {
  309. label: {
  310. show: false
  311. }
  312. }
  313. },
  314. value: 2
  315. }
  316. ]
  317. }
  318. ]
  319. }
  320. ]
  321. };
  322. </textarea>
  323. </div><!--/.well -->
  324. </div><!--/span-->
  325. <div id="graphic" class="col-md-8">
  326. <div id="main" class="main"></div>
  327. <div>
  328. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  329. <span class="text-primary">切换主题</span>
  330. <select id="theme-select"></select>
  331. <span id='wrong-message' style="color:red"></span>
  332. </div>
  333. </div><!--/span-->
  334. </div><!--/row-->
  335. </div><!--/.fluid-container-->
  336. <footer id="footer"></footer>
  337. <!-- Le javascript
  338. ================================================== -->
  339. <!-- Placed at the end of the document so the pages load faster -->
  340. <script src="../asset/js/jquery.min.js"></script>
  341. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  342. <script src="../asset/js/bootstrap.min.js"></script>
  343. <script src="../asset/js/echartsExample.js"></script>
  344. </body>
  345. </html>