test-1280.js 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165
  1. /****** PLACE YOUR CUSTOM STYLES HERE ******/
  2. /*青岛研锦网络科技有限公司 版权所有*/
  3. var legal_person_data = {"uploadData":[{"count":630},{"count":986},{"count":792},{"count":642},{"count":521},{"count":573}
  4. ,{"count":832},{"count":747},{"count":983},{"count":836},{"count":831},{"count":633}],
  5. "updateData":[{"count":110},{"count":181},{"count":123},{"count":197},{"count":123},{"count":173}
  6. ,{"count":123},{"count":151},{"count":101},{"count":152},{"count":101},{"count":177}],
  7. "viewData":[{"count":651},{"count":842},{"count":223},{"count":223},{"count":221},{"count":812}
  8. ,{"count":928},{"count":219},{"count":613},{"count":254},{"count":981},{"count":301}]};
  9. var people_data = {"uploadData":[{"count":1300},{"count":1686},{"count":1692},{"count":1742},{"count":1621},{"count":773}
  10. ,{"count":832},{"count":1047},{"count":1483},{"count":1336},{"count":831},{"count":973}],
  11. "updateData":[{"count":103},{"count":281},{"count":203},{"count":197},{"count":173},{"count":154}
  12. ,{"count":223},{"count":251},{"count":201},{"count":252},{"count":201},{"count":277}],
  13. "viewData":[{"count":651},{"count":842},{"count":223},{"count":223},{"count":221},{"count":812}
  14. ,{"count":928},{"count":219},{"count":613},{"count":254},{"count":981},{"count":301}]};
  15. var picture_data = {"uploadData":[{"count":330},{"count":786},{"count":492},{"count":842},{"count":421},{"count":673}
  16. ,{"count":932},{"count":447},{"count":583},{"count":436},{"count":331},{"count":433}],
  17. "updateData":[{"count":10},{"count":81},{"count":23},{"count":97},{"count":23},{"count":73}
  18. ,{"count":23},{"count":51},{"count":01},{"count":52},{"count":01},{"count":77}],
  19. "viewData":[{"count":451},{"count":342},{"count":523},{"count":323},{"count":421},{"count":812}
  20. ,{"count":728},{"count":619},{"count":613},{"count":554},{"count":481},{"count":301}]};
  21. var Tpl1 = '<li>' +
  22. '<p class="data-count">5681</p>' +
  23. '<span class="data-name">数据总量</span>' +
  24. '</li>' +
  25. '<li>' +
  26. '<p class="data-count">1331</p>' +
  27. '<span class="data-name">更新量</span>' +
  28. '</li>' +
  29. '<li>' +
  30. '<p class="data-count">3753</p>' +
  31. '<span class="data-name">共享次数</span>' +
  32. '</li>' ;
  33. var Tpl2 = '<li>' +
  34. '<p class="data-count">3971</p>' +
  35. '<span class="data-name">数据总量</span>' +
  36. '</li>' +
  37. '<li>' +
  38. '<p class="data-count">1141</p>' +
  39. '<span class="data-name">更新量</span>' +
  40. '</li>' +
  41. '<li>' +
  42. '<p class="data-count">3753</p>' +
  43. '<span class="data-name">共享次数</span>' +
  44. '</li>' ;
  45. var Tpl3 = '<li>' +
  46. '<p class="data-count">4742</p>' +
  47. '<span class="data-name">数据总量</span>' +
  48. '</li>' +
  49. '<li>' +
  50. '<p class="data-count">1231</p>' +
  51. '<span class="data-name">更新量</span>' +
  52. '</li>' +
  53. '<li>' +
  54. '<p class="data-count">2983</p>' +
  55. '<span class="data-name">共享次数</span>' +
  56. '</li>' ;
  57. $('.com-screen-content .use-data').html(Tpl1);
  58. // 基于准备好的dom,初始化echarts实例
  59. var myChart1= echarts.init(document.getElementById('main1'));
  60. var myChart2 = echarts.init(document.getElementById('main2'));
  61. var myChart3 = echarts.init(document.getElementById('main3'));
  62. //var myChart4 = echarts.init(document.getElementById('main4'));
  63. var myChart5 = echarts.init(document.getElementById('main5'));
  64. var myChart6 = echarts.init(document.getElementById('main6'));
  65. var myChart7 = echarts.init(document.getElementById('main7'));
  66. getNowFormatDate();
  67. init_myChart1();
  68. init_myChart2();
  69. init_myChart3(legal_person_data);
  70. init_myChart5();
  71. init_myChart6();
  72. init_myChart7();
  73. function init_myChart3(data) {
  74. var uploadCnt = [];
  75. var updateCnt = [];
  76. var viewCnt = [];
  77. if (data.uploadData != null) {
  78. for (var i = 0; i < data.uploadData.length; i++) {
  79. uploadCnt.push(data.uploadData[i].count);
  80. }
  81. }
  82. if (data.updateData != null) {
  83. for (var i = 0; i < data.updateData.length; i++) {
  84. updateCnt.push(data.updateData[i].count);
  85. }
  86. }
  87. if (data.viewData != null) {
  88. for (var i = 0; i < data.viewData.length; i++) {
  89. viewCnt.push(data.viewData[i].count);
  90. }
  91. }
  92. option = {
  93. tooltip: {
  94. trigger: 'axis',
  95. formatter: function (params, ticket, callback) {
  96. var res = '';
  97. for (var i = 0, l = params.length; i < l; i++) {
  98. res += '' + params[i].seriesName + ' : ' + params[i].value + '<br>';
  99. }
  100. return res;
  101. },
  102. transitionDuration: 0,
  103. backgroundColor: 'rgba(83,93,105,0.8)',
  104. borderColor: '#535b69',
  105. borderRadius: 8,
  106. borderWidth: 2,
  107. padding: [5, 10],
  108. axisPointer: {
  109. type: 'line',
  110. lineStyle: {
  111. type: 'dashed',
  112. color: '#ffff00'
  113. }
  114. }
  115. },
  116. legend: {
  117. icon: 'circle',
  118. itemWidth: 8,
  119. itemHeight: 8,
  120. itemGap: 10,
  121. top: '16',
  122. right: '10',
  123. data: ['数据总量','共享次数','更新量'],
  124. textStyle: {
  125. fontSize: 14,
  126. color: '#a0a8b9'
  127. }
  128. },
  129. grid: {
  130. top: '46',
  131. left: '13%',
  132. right: '10',
  133. //bottom: '10%',
  134. containLabel: false
  135. },
  136. xAxis: [{
  137. type: 'category',
  138. boundaryGap: false,
  139. axisLabel: {
  140. interval: 0,
  141. fontSize:14
  142. },
  143. axisLine: {
  144. show: false,
  145. lineStyle: {
  146. color: '#a0a8b9'
  147. }
  148. },
  149. axisTick: {
  150. show: false
  151. },
  152. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月'],
  153. offset: 10
  154. }],
  155. yAxis: [{
  156. type: 'value',
  157. axisLine: {
  158. show: false,
  159. lineStyle: {
  160. color: '#a0a8b9'
  161. }
  162. },
  163. axisLabel: {
  164. margin: 10,
  165. textStyle: {
  166. fontSize: 14
  167. }
  168. },
  169. splitLine: {
  170. lineStyle: {
  171. color: '#2b3646'
  172. }
  173. },
  174. axisTick: {
  175. show: false
  176. }
  177. }],
  178. series: [{
  179. name: '数据总量',
  180. type: 'line',
  181. smooth: true,
  182. showSymbol: false,
  183. lineStyle: {
  184. normal: {
  185. width: 2
  186. }
  187. },
  188. areaStyle: {
  189. normal: {
  190. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  191. offset: 0,
  192. color: 'rgba(137, 189, 27, 0.3)'
  193. }, {
  194. offset: 0.8,
  195. color: 'rgba(137, 189, 27, 0)'
  196. }], false),
  197. shadowColor: 'rgba(0, 0, 0, 0.1)',
  198. shadowBlur: 10
  199. }
  200. },
  201. itemStyle: {
  202. normal: {
  203. color: '#1cc840'
  204. }
  205. },
  206. data: uploadCnt
  207. }, {
  208. name: '共享次数',
  209. type: 'line',
  210. smooth: true,
  211. showSymbol: false,
  212. lineStyle: {
  213. normal: {
  214. width: 2
  215. }
  216. },
  217. areaStyle: {
  218. normal: {
  219. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  220. offset: 0,
  221. color: 'rgba(219, 50, 51, 0.3)'
  222. }, {
  223. offset: 0.8,
  224. color: 'rgba(219, 50, 51, 0)'
  225. }], false),
  226. shadowColor: 'rgba(0, 0, 0, 0.1)',
  227. shadowBlur: 10
  228. }
  229. },
  230. itemStyle: {
  231. normal: {
  232. color: '#eb5690'
  233. }
  234. },
  235. data: viewCnt
  236. }, {
  237. name: '更新量',
  238. type: 'line',
  239. smooth: true,
  240. showSymbol: false,
  241. lineStyle: {
  242. normal: {
  243. width: 2
  244. }
  245. },
  246. areaStyle: {
  247. normal: {
  248. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  249. offset: 0,
  250. color: 'rgba(0, 136, 212, 0.3)'
  251. }, {
  252. offset: 0.8,
  253. color: 'rgba(0, 136, 212, 0)'
  254. }], false),
  255. shadowColor: 'rgba(0, 0, 0, 0.1)',
  256. shadowBlur: 10
  257. }
  258. },
  259. itemStyle: {
  260. normal: {
  261. color: '#43bbfb'
  262. }
  263. },
  264. data: updateCnt
  265. }
  266. ]
  267. };
  268. myChart3.setOption(option);
  269. }
  270. function init_myChart2() {
  271. var data = {"uploadData":[{"count":3230},{"count":2986},{"count":3392},{"count":2642},{"count":3521},{"count":2573}
  272. ,{"count":3132},{"count":3147},{"count":3283},{"count":3336},{"count":3831},{"count":3633}],
  273. "updateData":[{"count":310},{"count":281},{"count":123},{"count":97},{"count":323},{"count":373}
  274. ,{"count":423},{"count":451},{"count":501},{"count":452},{"count":201},{"count":177}],
  275. "viewData":[{"count":1651},{"count":1842},{"count":2223},{"count":2123},{"count":2021},{"count":1812}
  276. ,{"count":1928},{"count":2019},{"count":2613},{"count":2754},{"count":2981},{"count":3001}]};
  277. var uploadCnt = [];
  278. var updateCnt = [];
  279. var viewCnt = [];
  280. if (data.uploadData != null) {
  281. for (var i = 0; i < data.uploadData.length; i++) {
  282. uploadCnt.push(data.uploadData[i].count);
  283. }
  284. }
  285. if (data.updateData != null) {
  286. for (var i = 0; i < data.updateData.length; i++) {
  287. updateCnt.push(data.updateData[i].count);
  288. }
  289. }
  290. if (data.viewData != null) {
  291. for (var i = 0; i < data.viewData.length; i++) {
  292. viewCnt.push(data.viewData[i].count);
  293. }
  294. }
  295. option = {
  296. tooltip: {
  297. trigger: 'axis',
  298. formatter: function (params, ticket, callback) {
  299. var res = '';
  300. for (var i = 0, l = params.length; i < l; i++) {
  301. res += '' + params[i].seriesName + ' : ' + params[i].value + '<br>';
  302. }
  303. return res;
  304. },
  305. transitionDuration: 0,
  306. backgroundColor: 'rgba(83,93,105,0.8)',
  307. borderColor: '#535b69',
  308. borderRadius: 8,
  309. borderWidth: 2,
  310. padding: [5, 10],
  311. axisPointer: {
  312. type: 'line',
  313. lineStyle: {
  314. type: 'dashed',
  315. color: '#ffff00'
  316. }
  317. }
  318. },
  319. legend: {
  320. icon: 'circle',
  321. itemWidth: 8,
  322. itemHeight: 8,
  323. itemGap: 10,
  324. top: '16',
  325. right: '10',
  326. data: ['数据总量','共享次数','更新量'],
  327. textStyle: {
  328. fontSize: 14,
  329. color: '#a0a8b9'
  330. }
  331. },
  332. grid: {
  333. top:'46',
  334. left: '13%',
  335. right: '10',
  336. //bottom: '10%',
  337. containLabel: false
  338. },
  339. xAxis: [{
  340. type: 'category',
  341. boundaryGap: false,
  342. axisLabel: {
  343. interval: 0,
  344. fontSize:14
  345. },
  346. axisLine: {
  347. show: false,
  348. lineStyle: {
  349. color: '#a0a8b9'
  350. }
  351. },
  352. axisTick: {
  353. show: false
  354. },
  355. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月'],
  356. offset: 10
  357. }],
  358. yAxis: [{
  359. type: 'value',
  360. axisLine: {
  361. show: false,
  362. lineStyle: {
  363. color: '#a0a8b9'
  364. }
  365. },
  366. axisLabel: {
  367. margin: 10,
  368. textStyle: {
  369. fontSize: 14
  370. }
  371. },
  372. splitLine: {
  373. lineStyle: {
  374. color: '#2b3646'
  375. }
  376. },
  377. axisTick: {
  378. show: false
  379. }
  380. }],
  381. series: [{
  382. name: '数据总量',
  383. type: 'line',
  384. smooth: true,
  385. showSymbol: false,
  386. lineStyle: {
  387. normal: {
  388. width: 2
  389. }
  390. },
  391. areaStyle: {
  392. normal: {
  393. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  394. offset: 0,
  395. color: 'rgba(137, 189, 27, 0.3)'
  396. }, {
  397. offset: 0.8,
  398. color: 'rgba(137, 189, 27, 0)'
  399. }], false),
  400. shadowColor: 'rgba(0, 0, 0, 0.1)',
  401. shadowBlur: 10
  402. }
  403. },
  404. itemStyle: {
  405. normal: {
  406. color: '#1cc840'
  407. }
  408. },
  409. data: uploadCnt
  410. }, {
  411. name: '共享次数',
  412. type: 'line',
  413. smooth: true,
  414. showSymbol: false,
  415. lineStyle: {
  416. normal: {
  417. width: 2
  418. }
  419. },
  420. areaStyle: {
  421. normal: {
  422. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  423. offset: 0,
  424. color: 'rgba(219, 50, 51, 0.3)'
  425. }, {
  426. offset: 0.8,
  427. color: 'rgba(219, 50, 51, 0)'
  428. }], false),
  429. shadowColor: 'rgba(0, 0, 0, 0.1)',
  430. shadowBlur: 10
  431. }
  432. },
  433. itemStyle: {
  434. normal: {
  435. color: '#eb5690'
  436. }
  437. },
  438. data: viewCnt
  439. }, {
  440. name: '更新量',
  441. type: 'line',
  442. smooth: true,
  443. showSymbol: false,
  444. lineStyle: {
  445. normal: {
  446. width: 2
  447. }
  448. },
  449. areaStyle: {
  450. normal: {
  451. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  452. offset: 0,
  453. color: 'rgba(0, 136, 212, 0.3)'
  454. }, {
  455. offset: 0.8,
  456. color: 'rgba(0, 136, 212, 0)'
  457. }], false),
  458. shadowColor: 'rgba(0, 0, 0, 0.1)',
  459. shadowBlur: 10
  460. }
  461. },
  462. itemStyle: {
  463. normal: {
  464. color: '#43bbfb'
  465. }
  466. },
  467. data: updateCnt
  468. }
  469. ]
  470. };
  471. myChart2.setOption(option);
  472. }
  473. function init_myChart1(){
  474. option = {
  475. tooltip : {
  476. trigger: 'item',
  477. formatter: "{a} <br/>{b} : {c} ({d}%)"
  478. },
  479. color:['#8fc31f','#f35833','#00ccff','#ffcc00','#f5e965','#a74faf','#ff9668'],
  480. series : [
  481. {
  482. name: '资源总量构成',
  483. type: 'pie',
  484. radius : '30%',
  485. center: ['50%', '50%'],
  486. data:[
  487. {value:435, name:'公安局'},
  488. {value:679, name:'民政局'},
  489. {value:848, name:'气象局'},
  490. {value:348, name:'统计局'},
  491. {value:679, name:'交通局'},
  492. {value:848, name:'人社局'},
  493. {value:1348, name:'其他'}
  494. ],
  495. itemStyle: {
  496. emphasis: {
  497. shadowBlur: 10,
  498. shadowOffsetX: 0,
  499. shadowColor: 'rgba(0, 0, 0, 0.5)'
  500. }
  501. },
  502. itemStyle: {
  503. normal: {
  504. label:{
  505. show: true,
  506. // position:'inside',
  507. formatter: '{b} : {c} ({d}%)' ,
  508. fontSize : 10, //文字的字体大小
  509. }
  510. },
  511. labelLine :{show:true}
  512. }
  513. }
  514. ]
  515. };
  516. // 使用刚指定的配置项和数据显示图表。
  517. myChart1.setOption(option);
  518. }
  519. function init_myChart5(){
  520. //var XData=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"];
  521. //var yData=[1243,2315,1164,3021,3521,4121,2001,1983,2541,2612,2331,1992];
  522. var XData=["一月","二月","三月","四月","五月","六月","七月","八月","九月"];
  523. var yData=[1243,2315,1164,3021,3521,4121,2001,1983,1432];
  524. option = {
  525. backgroundColor:"",
  526. xAxis: {
  527. axisTick: {
  528. show: false
  529. },
  530. splitLine: {
  531. show: false
  532. },
  533. splitArea: {
  534. show: false
  535. },
  536. data: XData,
  537. axisLabel: {
  538. formatter: function(value) {
  539. var ret = ""; //拼接加\n返回的类目项
  540. var maxLength = 1; //每项显示文字个数
  541. var valLength = value.length; //X轴类目项的文字个数
  542. var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
  543. if (rowN > 1) //如果类目项的文字大于3,
  544. {
  545. for (var i = 0; i < rowN; i++) {
  546. var temp = ""; //每次截取的字符串
  547. var start = i * maxLength; //开始截取的位置
  548. var end = start + maxLength; //结束截取的位置
  549. //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
  550. temp = value.substring(start, end) + "\n";
  551. ret += temp; //凭借最终的字符串
  552. }
  553. return ret;
  554. } else {
  555. return value;
  556. }
  557. },
  558. interval: 0,
  559. fontSize: 14,
  560. fontWeight: 100,
  561. textStyle: {
  562. color: '#9faeb5',
  563. }
  564. },
  565. axisLine: {
  566. lineStyle: {
  567. color: '#4d4d4d'
  568. }
  569. }
  570. },
  571. yAxis: {
  572. axisTick: {
  573. show: false
  574. },
  575. splitLine: {
  576. show: false
  577. },
  578. splitArea: {
  579. show: false
  580. },
  581. axisLabel: {
  582. textStyle: {
  583. color: '#9faeb5',
  584. fontSize: 16,
  585. }
  586. },
  587. axisLine: {
  588. lineStyle: {
  589. color: '#4d4d4d'
  590. }
  591. }
  592. },
  593. "tooltip": {
  594. "trigger": "axis",
  595. transitionDuration: 0,
  596. backgroundColor: 'rgba(83,93,105,0.8)',
  597. borderColor: '#535b69',
  598. borderRadius: 8,
  599. borderWidth: 2,
  600. padding: [5, 10],
  601. formatter: function (params, ticket, callback) {
  602. var res = '';
  603. for (var i = 0, l = params.length; i < l; i++) {
  604. res += '' + params[i].seriesName + ' : ' + params[i].value + '<br>';
  605. }
  606. return res;
  607. },
  608. axisPointer: {
  609. type: 'line',
  610. lineStyle: {
  611. type: 'dashed',
  612. color: '#ffff00'
  613. }
  614. }
  615. },
  616. series: [{
  617. name:'共享次数',
  618. type:"bar",
  619. itemStyle: {
  620. normal: {
  621. color: {
  622. type: 'linear',
  623. x: 0,
  624. y: 0,
  625. x2: 0,
  626. y2: 1,
  627. colorStops: [{
  628. offset: 0,
  629. color: '#00d386' // 0% 处的颜色
  630. }, {
  631. offset: 1,
  632. color: '#0076fc' // 100% 处的颜色
  633. }],
  634. globalCoord: false // 缺省为 false
  635. },
  636. barBorderRadius: 15,
  637. }
  638. },
  639. label: {
  640. normal: {
  641. show: true,
  642. position: "top",
  643. textStyle: {
  644. color: "#ffc72b",
  645. fontSize: 10
  646. }
  647. }
  648. },
  649. data: yData,
  650. barWidth: 16,
  651. },{
  652. name:'折线',
  653. type:'line',
  654. itemStyle : { /*设置折线颜色*/
  655. normal : {
  656. /* color:'#c4cddc'*/
  657. }
  658. },
  659. data:yData
  660. }]
  661. };
  662. myChart5.setOption(option);
  663. }
  664. //刷新myChart5数据
  665. function init_myChart6(){
  666. var data = {"uploadData":[{"count":5421,"areaName":"公共服务"},{"count":6512,"areaName":"健康保障"},{"count":3721,"areaName":"安全生产"},{"count":2842,"areaName":"价格监督"}
  667. ,{"count":6427,"areaName":"能源安全"},{"count":4422,"areaName":"信用体系"},{"count":1020,"areaName":"城乡建设"},{"count":1421,"areaName":"社区治理"},{"count":1776,"areaName":"生态环保"}
  668. ,{"count":2428,"areaName":"应急维稳"}]};
  669. var uploadCnt = [];
  670. var updateCnt = [];
  671. //var collectionCnt = [];
  672. //var dailyCnt = [];
  673. var viewCnt = [];
  674. var areaNameS = [];
  675. if (data.uploadData) {
  676. for (var i = 0; i < data.uploadData.length; i++) {
  677. uploadCnt.push(data.uploadData[i].count);
  678. areaNameS.push(data.uploadData[i].areaName);
  679. }
  680. }
  681. if (data.updateData) {
  682. for (var i = 0; i < data.updateData.length; i++) {
  683. updateCnt.push(data.updateData[i].count);
  684. }
  685. }
  686. if (data.viewData) {
  687. for (var i = 0; i < data.viewData.length; i++) {
  688. viewCnt.push(data.viewData[i].count);
  689. }
  690. }
  691. option = {
  692. "tooltip": {
  693. "trigger": "axis",
  694. transitionDuration: 0,
  695. backgroundColor: 'rgba(83,93,105,0.8)',
  696. borderColor: '#535b69',
  697. borderRadius: 8,
  698. borderWidth: 2,
  699. padding: [5, 10],
  700. formatter: function (params, ticket, callback) {
  701. var res = '';
  702. for (var i = 0, l = params.length; i < l; i++) {
  703. res += '' + params[i].seriesName + ' : ' + params[i].value + '<br>';
  704. }
  705. return res;
  706. },
  707. axisPointer: {
  708. type: 'line',
  709. lineStyle: {
  710. type: 'dashed',
  711. color: '#ffff00'
  712. }
  713. }
  714. },
  715. "grid": {
  716. "top": '40',
  717. "left": '30',
  718. "right": '10',
  719. "bottom": '40',
  720. textStyle: {
  721. color: "#fff"
  722. }
  723. },
  724. "legend": {
  725. right: '24',
  726. top: "24",
  727. itemWidth: 8,
  728. itemHeight: 12,
  729. textStyle: {
  730. color: '#fff',
  731. fontSize:14
  732. },
  733. "data": ['资源总量'],
  734. },
  735. "calculable": true,
  736. xAxis: [{
  737. 'type': 'category',
  738. "axisTick": {
  739. "show": false
  740. },
  741. "axisLine": {
  742. "show": false,
  743. lineStyle: {
  744. color: '#868c96'
  745. }
  746. },
  747. "axisLabel": {
  748. "interval": 0,
  749. fontSize:14,
  750. formatter:function(value)
  751. {
  752. var ret = "";//拼接加\n返回的类目项
  753. var maxLength = 2;//每项显示文字个数
  754. var valLength = value.length;//X轴类目项的文字个数
  755. var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
  756. if (rowN > 1)//如果类目项的文字大于3,
  757. {
  758. for (var i = 0; i < rowN; i++) {
  759. var temp = "";//每次截取的字符串
  760. var start = i * maxLength;//开始截取的位置
  761. var end = start + maxLength;//结束截取的位置
  762. //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
  763. temp = value.substring(start, end) + "\n";
  764. ret += temp; //凭借最终的字符串
  765. }
  766. return ret;
  767. }
  768. else {
  769. return value;
  770. }
  771. }
  772. },
  773. "splitArea": {
  774. "show": false
  775. },
  776. 'data': areaNameS,
  777. splitLine: {
  778. show: false
  779. }
  780. }],
  781. "yAxis": [
  782. {
  783. "type": "value",
  784. offset: -14,
  785. "splitLine": {
  786. "show": false
  787. },
  788. "axisLine": {
  789. "show": false,
  790. lineStyle: {
  791. color: '#868c96'
  792. }
  793. },
  794. "axisTick": {
  795. "show": false
  796. },
  797. "axisLabel": {
  798. "interval": 0,
  799. fontSize:14
  800. },
  801. "splitArea": {
  802. "show": false
  803. }
  804. }],
  805. "series": [
  806. {
  807. "name": "资源总量",
  808. "type": "bar",
  809. "barGap": "10%",
  810. itemStyle: {//图形样式
  811. normal: {
  812. "color": '#4a4df0'
  813. }
  814. },
  815. label: {
  816. normal: {
  817. show: true,
  818. position: "top",
  819. textStyle: {
  820. color: "#ffc72b",
  821. fontSize: 10
  822. }
  823. }
  824. },
  825. "data": uploadCnt,
  826. barWidth: 14,
  827. },{
  828. name:'折线',
  829. type:'line',
  830. itemStyle : { /*设置折线颜色*/
  831. normal : {
  832. color:'#c7b198'
  833. }
  834. },
  835. data:[5421, 6512, 4621, 2842,6427, 4422,1020,1421,1776,2428],
  836. }
  837. ]
  838. };
  839. // 使用刚指定的配置项和数据显示图表。
  840. myChart6.setOption(option);
  841. }
  842. function init_myChart7(){
  843. var colorList = [
  844. '#ff2600',
  845. '#ffc000',
  846. '#00ad4e',
  847. '#0073c2',
  848. '#165868',
  849. '#e76f00',
  850. '#316194',
  851. '#723761',
  852. '#00b2f1',
  853. '#4d6022',
  854. '#4b83bf',
  855. '#f9c813',
  856. '#0176c0'
  857. ];
  858. var xData = ['公共服务','健康保障','安全生产','价格监督','能源安全','信用体系', '城乡建设', '社区治理', '生态环保','应急维稳'];
  859. var yData = [2912,3991,4621,3941,3313,6631,5543,4463,6541,3381];
  860. option = {
  861. color:colorList,
  862. "tooltip": {
  863. "trigger": "axis",
  864. transitionDuration: 0,
  865. backgroundColor: 'rgba(83,93,105,0.8)',
  866. borderColor: '#535b69',
  867. borderRadius: 8,
  868. borderWidth: 2,
  869. padding: [5, 10],
  870. formatter: function (params, ticket, callback) {
  871. var res = '';
  872. for (var i = 0, l = params.length; i < l; i++) {
  873. res += '' + params[i].seriesName + ' : ' + params[i].value + '<br>';
  874. }
  875. return res;
  876. },
  877. axisPointer: {
  878. type: 'line',
  879. lineStyle: {
  880. type: 'dashed',
  881. color: '#ffff00'
  882. }
  883. }
  884. },
  885. toolbox: {
  886. show : true,
  887. feature : {
  888. mark : {
  889. show: true
  890. },
  891. }
  892. },
  893. grid: {
  894. "borderWidth": 0,
  895. "top": '40',
  896. "left": '30',
  897. "right": '10',
  898. "bottom": '40',
  899. textStyle: {
  900. color: "#fff"
  901. }
  902. },
  903. xAxis : [
  904. {
  905. 'type': 'category',
  906. "axisTick": {
  907. "show": false
  908. },
  909. "axisLine": {
  910. "show": false,
  911. lineStyle: {
  912. color: '#868c96'
  913. }
  914. },
  915. "axisLabel": {
  916. "interval": 0,
  917. fontSize:14,
  918. formatter:function(value)
  919. {
  920. var ret = "";//拼接加\n返回的类目项
  921. var maxLength = 2;//每项显示文字个数
  922. var valLength = value.length;//X轴类目项的文字个数
  923. var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
  924. if (rowN > 1)//如果类目项的文字大于3,
  925. {
  926. for (var i = 0; i < rowN; i++) {
  927. var temp = "";//每次截取的字符串
  928. var start = i * maxLength;//开始截取的位置
  929. var end = start + maxLength;//结束截取的位置
  930. //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
  931. temp = value.substring(start, end) + "\n";
  932. ret += temp; //凭借最终的字符串
  933. }
  934. return ret;
  935. }
  936. else {
  937. return value;
  938. }
  939. }
  940. },
  941. "splitArea": {
  942. "show": false
  943. },
  944. 'data': xData,
  945. splitLine: {
  946. show: false
  947. },
  948. }
  949. ],
  950. yAxis : [
  951. {
  952. "type": "value",
  953. offset: -14,
  954. "splitLine": {
  955. "show": false
  956. },
  957. "axisLine": {
  958. "show": false,
  959. lineStyle: {
  960. color: '#868c96'
  961. }
  962. },
  963. "axisTick": {
  964. "show": false
  965. },
  966. "axisLabel": {
  967. "interval": 0,
  968. fontSize:14
  969. },
  970. "splitArea": {
  971. "show": false
  972. }
  973. }
  974. ],
  975. series : [
  976. {
  977. name:'共享次数',
  978. type:'bar',
  979. data:yData,
  980. itemStyle: {
  981. normal: {
  982. color: function(params) {
  983. // build a color map as your need.
  984. var colorList = [
  985. '#ff2600',
  986. '#ffc000',
  987. '#00ad4e',
  988. '#0073c2',
  989. '#165868',
  990. '#e76f00',
  991. '#316194',
  992. '#723761',
  993. '#00b2f1',
  994. '#4d6022',
  995. '#4b83bf',
  996. '#f9c813',
  997. '#0176c0'
  998. ];
  999. return colorList[params.dataIndex]
  1000. },
  1001. }
  1002. },
  1003. barWidth: 14,
  1004. label: {
  1005. normal: {
  1006. show: true,
  1007. position: "top",
  1008. textStyle: {
  1009. color: "#ffc72b",
  1010. fontSize: 10
  1011. }
  1012. }
  1013. },
  1014. },
  1015. {
  1016. name:'折线',
  1017. type:'line',
  1018. itemStyle : { /*设置折线颜色*/
  1019. normal : {
  1020. color:'#d3d5fd'
  1021. }
  1022. },
  1023. data:yData
  1024. }
  1025. ]
  1026. };
  1027. // 使用刚指定的配置项和数据显示图表。
  1028. myChart7.setOption(option);
  1029. }
  1030. //获取当前时间
  1031. function getNowFormatDate() {
  1032. var date = new Date();
  1033. var year = date.getFullYear();
  1034. var month = date.getMonth() + 1;
  1035. var strDate = date.getDate();
  1036. var Hour = date.getHours(); // 获取当前小时数(0-23)
  1037. var Minute = date.getMinutes(); // 获取当前分钟数(0-59)
  1038. var Second = date.getSeconds(); // 获取当前秒数(0-59)
  1039. var show_day=new Array('星期日','星期一','星期二','星期三','星期四','星期五','星期六');
  1040. var day=date.getDay();
  1041. if (Hour<10) {
  1042. Hour = "0" + Hour;
  1043. }
  1044. if (Minute <10) {
  1045. Minute = "0" + Minute;
  1046. }
  1047. if (Second <10) {
  1048. Second = "0" + Second;
  1049. }
  1050. if (month >= 1 && month <= 9) {
  1051. month = "0" + month;
  1052. }
  1053. if (strDate >= 0 && strDate <= 9) {
  1054. strDate = "0" + strDate;
  1055. }
  1056. var currentdate = '<div><p>'+year + '年' + month +'月' + strDate+'号</p><p>'+show_day[day]+'</p></div>';
  1057. var HMS = Hour + ':' + Minute +':' + Second;
  1058. var temp_time = year+'-'+month+'-'+strDate+' '+HMS;
  1059. $('.nowTime li:nth-child(1)').html(HMS);
  1060. $('.nowTime li:nth-child(2)').html(currentdate);
  1061. //$('.topRec_List li div:nth-child(3)').html(temp_time);
  1062. setTimeout(getNowFormatDate,1000);//每隔1秒重新调用一次该函数
  1063. }
  1064. var resourceDataType = $('.data-label li.active').data('type');//用于切换基础库
  1065. function urlType() {
  1066. resourceDataType = $('.data-label li.active').data('type');
  1067. if (resourceDataType == 1) {
  1068. init_myChart3(legal_person_data);
  1069. $('.com-screen-content .use-data').html(Tpl1);
  1070. } else if (resourceDataType == 2) {
  1071. init_myChart3(people_data);
  1072. $('.com-screen-content .use-data').html(Tpl2);
  1073. } else if (resourceDataType == 3) {
  1074. init_myChart3( picture_data);
  1075. $('.com-screen-content .use-data').html(Tpl3);
  1076. }
  1077. }
  1078. var num =0 ;
  1079. // 资源类型定时器
  1080. function resourceType() {
  1081. $('.data-label li').eq(num).addClass('active').siblings().removeClass('active');
  1082. //$('.active-data-label').html($('.canvas-pic-two .data-label li.active').html());
  1083. urlType();
  1084. num++;
  1085. if (num >= 3) {
  1086. num = 0;
  1087. }
  1088. }
  1089. // 资源类型点击切换
  1090. $('.data-label').on('click', 'li', function () {
  1091. $(this).addClass('active').siblings().removeClass('active');
  1092. $('.active-data-label').html($('.data-label li.active').html());
  1093. urlType();
  1094. });
  1095. var oTimer = setInterval(resourceType, 3000);
  1096. // hover清除定时器
  1097. $('.data-label').hover(function () {
  1098. clearInterval(oTimer);
  1099. }, function () {
  1100. oTimer = setInterval(resourceType, 3000);
  1101. });
  1102. /*function resize(){
  1103. window.addEventListener("resize", () => {
  1104. this.myChart1.resize;
  1105. this.myChart2.resize;
  1106. this.myChart3.resize;
  1107. this.myChart5.resize;
  1108. this.myChart6.resize;
  1109. this.myChart7.resize;
  1110. });
  1111. }*/
  1112. setInterval(function (){
  1113. window.onresize = function () {
  1114. this.myChart1.resize;
  1115. this.myChart2.resize;
  1116. this.myChart3.resize;
  1117. this.myChart5.resize;
  1118. this.myChart6.resize;
  1119. this.myChart7.resize;
  1120. }
  1121. },200)
  1122. //myChart7.resize();