js.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1.  $(window).load(function(){$(".loading").fadeOut()})
  2. $(function () {
  3. echarts_2()
  4. echarts_3()
  5. echarts_4()
  6. echarts_5()
  7. echarts_6()
  8. function echarts_2() {
  9. // 基于准备好的dom,初始化echarts实例
  10. var myChart = echarts.init(document.getElementById('echart2'));
  11. var data = [683, 234, 234, 523, 345, 320, 280, 271, 254, 229, 210, 190, 182]
  12. var titlename = ['北京', '上海', '广州', '郑州', '武汉', '南京', '杭州', '东莞', '深圳', '虎门', '青岛', '石家庄', '安阳'];
  13. option = {
  14. grid: {
  15. left: '0',
  16. top:'0',
  17. right: '0',
  18. bottom: '0%',
  19. containLabel: true
  20. },
  21. xAxis: {
  22. show: false
  23. },
  24. yAxis: [{
  25. show: true,
  26. data: titlename,
  27. inverse: true,
  28. axisLine: { show: false},
  29. splitLine:{ show: false},
  30. axisTick:{ show: false},
  31. axisLabel: {
  32. textStyle: {
  33. color:'#fff'
  34. },
  35. },
  36. }, {
  37. show: false,
  38. inverse: true,
  39. data: data,
  40. axisLabel: {textStyle: {color: '#fff'}},
  41. axisLine: { show: false},
  42. splitLine:{ show: false},
  43. axisTick: { show: false},
  44. }],
  45. series: [{
  46. name: '条',
  47. type: 'bar',
  48. yAxisIndex: 0,
  49. data: data,
  50. barWidth: 15,
  51. itemStyle: {
  52. normal: {
  53. barBorderRadius: 50,
  54. color:'#1089E7',
  55. }
  56. },
  57. label: {
  58. normal: {
  59. show: true,
  60. position: 'right',
  61. formatter: '{c}',
  62. textStyle: {color: 'rgba(255,255,255,.5)'}
  63. }
  64. },
  65. }]
  66. };
  67. // 使用刚指定的配置项和数据显示图表。
  68. myChart.setOption(option);
  69. window.addEventListener("resize",function(){
  70. myChart.resize();
  71. });
  72. }
  73. function echarts_3() {
  74. // 基于准备好的dom,初始化echarts实例
  75. var myChart = echarts.init(document.getElementById('echart3'));
  76. option = {
  77. tooltip: {
  78. trigger: 'axis',
  79. axisPointer: {
  80. lineStyle: {
  81. color: '#dddc6b'
  82. }
  83. }
  84. },
  85. grid: {
  86. left: '10',
  87. top: '20',
  88. right: '30',
  89. bottom: '10',
  90. containLabel: true
  91. },
  92. xAxis: [{
  93. type: 'category',
  94. boundaryGap: false,
  95. axisLabel: {
  96. textStyle: {
  97. color: "rgba(255,255,255,.6)",
  98. fontSize:14,
  99. },
  100. },
  101. axisLine: {
  102. lineStyle: {
  103. color: 'rgba(255,255,255,.2)'
  104. }
  105. },
  106. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
  107. }, {
  108. axisPointer: {show: false},
  109. axisLine: { show: false},
  110. position: 'bottom',
  111. offset: 20,
  112. }],
  113. yAxis: [{
  114. type: 'value',
  115. axisTick: {show: false},
  116. splitNumber: 4,
  117. axisLine: {
  118. lineStyle: {
  119. color: 'rgba(255,255,255,.1)'
  120. }
  121. },
  122. axisLabel: {
  123. textStyle: {
  124. color: "rgba(255,255,255,.6)",
  125. fontSize:16,
  126. },
  127. },
  128. splitLine: {
  129. lineStyle: {
  130. color: 'rgba(255,255,255,.1)',
  131. type: 'dotted',
  132. }
  133. }
  134. }],
  135. series: [
  136. {
  137. name: '结算率',
  138. type: 'line',
  139. smooth: true,
  140. symbol: 'circle',
  141. symbolSize: 5,
  142. showSymbol: false,
  143. lineStyle: {
  144. normal: {
  145. color: 'rgba(31, 174, 234, 1)',
  146. width: 2
  147. }
  148. },
  149. areaStyle: {
  150. normal: {
  151. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  152. offset: 0,
  153. color: 'rgba(31, 174, 234, 0.4)'
  154. }, {
  155. offset: 0.8,
  156. color: 'rgba(31, 174, 234, 0.1)'
  157. }], false),
  158. shadowColor: 'rgba(0, 0, 0, 0.1)',
  159. }
  160. },
  161. itemStyle: {
  162. normal: {
  163. color: '#1f7eea',
  164. borderColor: 'rgba(31, 174, 234, .1)',
  165. borderWidth: 5
  166. }
  167. },
  168. data: [3, 6, 3, 6, 3, 9, 3,12, 6, 8, 3, 5, 9, 3]
  169. },
  170. ]
  171. };
  172. // 使用刚指定的配置项和数据显示图表。
  173. myChart.setOption(option);
  174. window.addEventListener("resize",function(){
  175. myChart.resize();
  176. });
  177. }
  178. function echarts_4() {
  179. // 基于准备好的dom,初始化echarts实例
  180. var myChart = echarts.init(document.getElementById('echart4'));
  181. var option = {
  182. grid: {
  183. left: '0',
  184. top: '30',
  185. right: '0',
  186. bottom: '10',
  187. containLabel: true
  188. },
  189. legend: {
  190. top: 0,
  191. textStyle: {
  192. color: "#fff",
  193. },
  194. itemWidth: 10, // 设置宽度
  195. itemHeight: 10, // 设置高度
  196. },
  197. tooltip: {
  198. trigger: 'axis',
  199. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  200. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  201. }
  202. },
  203. xAxis: {
  204. type: 'category',
  205. data: ["西进口右转","北进口直行","南进口直行",],
  206. axisTick: { //---坐标轴 刻度
  207. show: true, //---是否显示
  208. },
  209. axisLine: { //---坐标轴 轴线
  210. show: true, //---是否显示
  211. lineStyle: {
  212. color: 'rgba(255,255,255,.1)',
  213. width: 1,
  214. type: 'dotted',
  215. },
  216. },
  217. axisLabel: {//X轴文字
  218. textStyle: {
  219. fontSize: 12,
  220. color: '#fff'
  221. },
  222. },
  223. },
  224. yAxis: {
  225. type: 'value',
  226. splitLine: {//分割线
  227. show: true,
  228. lineStyle: {
  229. color: 'rgba(255,255,255,.1)',
  230. width: 1,
  231. type: 'dotted'
  232. }
  233. },
  234. axisLabel: {//Y轴刻度值
  235. formatter: '{value}',
  236. textStyle: {
  237. fontSize: 12,
  238. color: '#fff'
  239. },
  240. },
  241. axisLine: { //---坐标轴 轴线
  242. show: false, //---是否显示
  243. },
  244. },
  245. series: [{
  246. name: '原方案',
  247. type: 'bar',
  248. data: [3, 7,4],
  249. barWidth: 15,
  250. barGap: 1, //柱子之间间距 //柱图宽度 两种情况都要设置,设置series 中对应数据柱形的itemStyle属性下的emphasis和normal的barBorderRadius属性初始化时候圆角 鼠标移上去圆角
  251. itemStyle: {
  252. normal: {
  253. barBorderRadius: 50,
  254. color: "#446ACF",
  255. }
  256. },
  257. }, {
  258. name: '建议方案',
  259. type: 'bar',
  260. data: [6, 2,5],
  261. barWidth: 15, //柱图宽度
  262. itemStyle: {
  263. normal: { //设置颜色的渐变
  264. barBorderRadius: 50,
  265. color: "#4fb69d",
  266. }
  267. },
  268. }]
  269. };
  270. // 使用刚指定的配置项和数据显示图表。
  271. myChart.setOption(option);
  272. window.addEventListener("resize",function(){
  273. myChart.resize();
  274. });
  275. }
  276. function echarts_5() {
  277. // 基于准备好的dom,初始化echarts实例
  278. var myChart = echarts.init(document.getElementById('echart5'));
  279. option = {
  280. legend: {
  281. orient: 'vertical',
  282. itemWidth: 10,
  283. itemHeight: 10,
  284. textStyle:{
  285. color:'rgba(255,255,255,.5)'
  286. },
  287. top:'20%',
  288. right:30,
  289. data:['已入驻','已出售','已租赁','闲置房产']
  290. },
  291. color: ['#37a2da','#32c5e9','#9fe6b8','#ffdb5c','#ff9f7f','#fb7293','#e7bcf3','#8378ea'],
  292. tooltip : {
  293. trigger: 'item',
  294. formatter: "{b} : {c} ({d}%)"
  295. },
  296. calculable : true,
  297. series : [
  298. {
  299. type:'pie',
  300. radius : [20, 70],
  301. center: ["35%", "50%"],
  302. roseType : 'area',
  303. data:[
  304. {value:300, name:'已入驻'},
  305. {value:200, name:'已出售'},
  306. {value:205, name:'已租赁'},
  307. {value:180, name:'闲置房产'},
  308. ],
  309. label: {
  310. normal: {
  311. formatter: function(param) {
  312. return param.name +':\n' + param.value +'\n';
  313. }
  314. }
  315. },
  316. labelLine: {
  317. normal: {
  318. length:5,
  319. length2:15,
  320. lineStyle: { width: 1}
  321. }
  322. },
  323. itemStyle: {
  324. normal: {
  325. shadowBlur: 30,
  326. shadowColor: 'rgba(0, 0, 0, 0.4)'
  327. }
  328. },
  329. }
  330. ]
  331. };
  332. myChart.setOption(option);
  333. window.addEventListener("resize",function(){
  334. myChart.resize();
  335. });
  336. }
  337. function echarts_6() {
  338. // 基于准备好的dom,初始化echarts实例
  339. var myChart = echarts.init(document.getElementById('echart6'));
  340. option = {
  341. tooltip: {
  342. trigger: 'axis'
  343. },
  344. radar: [{
  345. indicator: [{
  346. text: '盈利能力',
  347. max: 100
  348. }, {
  349. text: '发展水平',
  350. max: 100
  351. }, {
  352. text: '融资能力',
  353. max: 100
  354. }, {
  355. text: '技术能力',
  356. max: 100
  357. }, {
  358. text: '企业规模',
  359. max: 100
  360. }],
  361. textStyle: {
  362. color: 'red'
  363. },
  364. center: ['50%', '50%'],
  365. radius: '70%',
  366. startAngle: 90,
  367. splitNumber: 4,
  368. shape: 'circle',
  369. name: {
  370. padding:-5,
  371. formatter: '{value}',
  372. textStyle: {
  373. color: 'rgba(255,255,255,.5)'
  374. }
  375. },
  376. splitArea: {
  377. areaStyle: {
  378. color: 'rgba(255,255,255,.05)'
  379. }
  380. },
  381. axisLine: {
  382. lineStyle: {
  383. color: 'rgba(255,255,255,.05)'
  384. }
  385. },
  386. splitLine: {
  387. lineStyle: {
  388. color: 'rgba(255,255,255,.05)'
  389. }
  390. }
  391. }, ],
  392. series: [{
  393. name: '雷达图',
  394. type: 'radar',
  395. tooltip: {
  396. trigger: 'item'
  397. },
  398. data: [{
  399. name: '园区平均值',
  400. value: [90, 80, 20, 10, 30],
  401. lineStyle: {
  402. normal: {
  403. color:'#03b48e',
  404. width:2,
  405. }
  406. },
  407. areaStyle: {
  408. normal: {
  409. color: '#03b48e',
  410. opacity:.4
  411. }
  412. },
  413. symbolSize: 0,
  414. }, {
  415. name: '当前园区',
  416. value: [30, 20, 75, 80, 70],
  417. symbolSize: 0,
  418. lineStyle: {
  419. normal: {
  420. color:'#3893e5',
  421. width:2,
  422. }
  423. },
  424. areaStyle: {
  425. normal: {
  426. color: 'rgba(19, 173, 255, 0.5)'
  427. }
  428. }
  429. }]
  430. }, ]
  431. };
  432. myChart.setOption(option);
  433. window.addEventListener("resize",function(){
  434. myChart.resize();
  435. });
  436. }
  437. })