socialAssistance.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. var jsonData1 = [
  2. ['product', '最低生活保障人数(人)', '发放低保金(万元)', '城市居民最低生活保障人数(人)', '城市居民发放低保金(万元)', '农村居民最低生活保障(人)', '农村居民最发放低保金(万元)'],
  3. ['2015', 11582, 5820.90, 10289, 5387.60, 1293, 433.30],
  4. ['2016', 10577, 6109.90, 9446, 5661.10, 1131, 448.80],
  5. ['2017', 10633, 6691.90, 9515, 6146.70, 1118, 545.20],
  6. ['2018', 10044, 7345.30, 8994, 6710.60, 1050, 634.70],
  7. ['2019', 8960, 6939.10, 8070, 6365.80, 890, 573.00],
  8. ['2020', 8297, 7853.00, 7496, 7216.00, 801, 637.00],
  9. ['2021', 7467, 5800.80, 6792, 5317.40, 675, 483.40]
  10. ]
  11. var jsonData2 = [
  12. ['product', '特困人员救助供养人数(人)', '发放救助金供养金(万元)', '城市特困人员救助供养人数(人)', '城市发放救助供养金(万元)', '农村特困人员救助供养人数(人)', '农村发放救助供养金(万元)'],
  13. ['2015', 2000, 50, 7000, 32, 767, 90],
  14. ['2016', 2000, 50, 7000, 32, 767, 90],
  15. ['2017', 2000, 50, 7000, 32, 767, 90],
  16. ['2018', 2000, 50, 7000, 32, 767, 90],
  17. ['2019', 2000, 50, 7000, 32, 767, 90],
  18. ['2020', 2000, 50, 7000, 32, 767, 90],
  19. ['2021', 2000, 50, 7000, 32, 767, 90]
  20. ]
  21. var jsonData3 = [
  22. ['product', '临时救助人数(人)', '发放金额(万元)'],
  23. ['2015', 2000, 50],
  24. ['2016', 2000, 50],
  25. ['2017', 2000, 50],
  26. ['2018', 2000, 50],
  27. ['2019', 2000, 50],
  28. ['2020', 2000, 50],
  29. ['2021', 2000, 50]
  30. ]
  31. //社会救助统计图
  32. var chartDom = document.getElementById('shjzEchar');
  33. var myChart = echarts.init(chartDom);
  34. var option;
  35. option = {
  36. grid: {
  37. // 网格线配置
  38. show: true,
  39. lineStyle: {
  40. color: ["#e9e9e9"],
  41. width: 1,
  42. type: "solid",
  43. },
  44. },
  45. legend: [{
  46. left: '20%',
  47. orient: 'vertical',
  48. data: ['最低生活保障人数(人)', '发放低保金(万元)']
  49. },
  50. {
  51. left: '40%',
  52. orient: 'vertical',
  53. data: ['城市居民最低生活保障人数(人)', '城市居民发放低保金(万元)']
  54. }, {
  55. left: '60%',
  56. orient: 'vertical',
  57. data: ['农村居民最低生活保障(人)', '农村居民最发放低保金(万元)']
  58. }
  59. ],
  60. tooltip: {
  61. trigger: 'axis',
  62. axisPointer: {
  63. type: 'shadow'
  64. },
  65. backgroundColor: "rgb(0 0 0 / 40%)",
  66. borderColor: 'transparent',
  67. textStyle: {
  68. color: '#fff'
  69. },
  70. },
  71. dataset: {
  72. source: jsonData1
  73. },
  74. xAxis: {
  75. type: 'category',
  76. axisTick: {
  77. show: true //坐标轴刻度线
  78. },
  79. axisLine: { //轴线
  80. show: true
  81. },
  82. splitLine: { //网格线
  83. show: true
  84. },
  85. axisLabel: {
  86. show: true,
  87. textStyle: {
  88. color: '#333', //更改坐标轴文字颜色
  89. fontSize: 14 //更改坐标轴文字大小
  90. }
  91. }
  92. },
  93. yAxis: [{
  94. type: 'value',
  95. min: 0,
  96. max: 15000,
  97. interval: 3000,
  98. axisLabel: {
  99. formatter: '{value}(人)'
  100. },
  101. axisTick: {
  102. show: true //坐标轴刻度线
  103. },
  104. axisLine: { //轴线
  105. show: true
  106. },
  107. splitLine: { //网格线
  108. show: true
  109. }
  110. },
  111. {
  112. type: 'value',
  113. min: 0,
  114. max: 10000,
  115. interval: 2000,
  116. axisLabel: {
  117. formatter: '{value}(万元)'
  118. }
  119. }],
  120. series: [{
  121. type: 'bar',
  122. itemStyle: {
  123. color: '#3C8DE6'
  124. }
  125. },
  126. {
  127. yAxisIndex: 1,
  128. type: 'bar',
  129. itemStyle: {
  130. color: '#FAA639'
  131. }
  132. },
  133. {
  134. type: 'bar',
  135. itemStyle: {
  136. color: '#8EC051'
  137. }
  138. },
  139. {
  140. type: 'bar',
  141. yAxisIndex: 1,
  142. itemStyle: {
  143. color: '#27C2C1'
  144. }
  145. },
  146. {
  147. type: 'bar',
  148. itemStyle: {
  149. color: '#4DC4E7'
  150. }
  151. },
  152. {
  153. type: 'bar',
  154. yAxisIndex: 1,
  155. itemStyle: {
  156. color: '#FA8A46'
  157. }
  158. },
  159. ]
  160. };
  161. option && myChart.setOption(option);
  162. $('.div-shjz .title').on('click', 'li', function () {
  163. if ($(this).data('type') == 1) {
  164. option = {
  165. grid: {
  166. // 网格线配置
  167. show: true,
  168. lineStyle: {
  169. color: ["#e9e9e9"],
  170. width: 1,
  171. type: "solid",
  172. },
  173. },
  174. legend: [{
  175. left: '20%',
  176. orient: 'vertical',
  177. data: ['最低生活保障人数(人)', '发放低保金(万元)']
  178. },
  179. {
  180. left: '40%',
  181. orient: 'vertical',
  182. data: ['城市居民最低生活保障人数(人)', '城市居民发放低保金(万元)']
  183. }, {
  184. left: '60%',
  185. orient: 'vertical',
  186. data: ['农村居民最低生活保障(人)', '农村居民最发放低保金(万元)']
  187. }
  188. ],
  189. tooltip: {
  190. trigger: 'axis',
  191. axisPointer: {
  192. type: 'shadow'
  193. },
  194. backgroundColor: "rgb(0 0 0 / 40%)",
  195. borderColor: 'transparent',
  196. textStyle: {
  197. color: '#fff'
  198. },
  199. },
  200. dataset: {
  201. source: jsonData1
  202. },
  203. xAxis: {
  204. type: 'category',
  205. axisTick: {
  206. show: true //坐标轴刻度线
  207. },
  208. axisLine: { //轴线
  209. show: true
  210. },
  211. splitLine: { //网格线
  212. show: true
  213. },
  214. axisLabel: {
  215. show: true,
  216. textStyle: {
  217. color: '#333', //更改坐标轴文字颜色
  218. fontSize: 14 //更改坐标轴文字大小
  219. }
  220. }
  221. },
  222. yAxis: [{
  223. type: 'value',
  224. min: 0,
  225. max: 15000,
  226. interval: 3000,
  227. axisLabel: {
  228. formatter: '{value}(人)'
  229. },
  230. axisTick: {
  231. show: true //坐标轴刻度线
  232. },
  233. axisLine: { //轴线
  234. show: true
  235. },
  236. splitLine: { //网格线
  237. show: true
  238. }
  239. },
  240. {
  241. type: 'value',
  242. min: 0,
  243. max: 10000,
  244. interval: 2000,
  245. axisLabel: {
  246. formatter: '{value}(万元)'
  247. }
  248. }],
  249. series: [{
  250. type: 'bar',
  251. itemStyle: {
  252. color: '#3C8DE6'
  253. }
  254. },
  255. {
  256. yAxisIndex: 1,
  257. type: 'bar',
  258. itemStyle: {
  259. color: '#FAA639'
  260. }
  261. },
  262. {
  263. type: 'bar',
  264. itemStyle: {
  265. color: '#8EC051'
  266. }
  267. },
  268. {
  269. type: 'bar',
  270. yAxisIndex: 1,
  271. itemStyle: {
  272. color: '#27C2C1'
  273. }
  274. },
  275. {
  276. type: 'bar',
  277. itemStyle: {
  278. color: '#4DC4E7'
  279. }
  280. },
  281. {
  282. type: 'bar',
  283. yAxisIndex: 1,
  284. itemStyle: {
  285. color: '#FA8A46'
  286. }
  287. },
  288. ]
  289. };
  290. option && myChart.setOption(option);
  291. } else if ($(this).data('type') == 2) {
  292. option = {
  293. grid: {
  294. // 网格线配置
  295. show: true,
  296. lineStyle: {
  297. color: ["#e9e9e9"],
  298. width: 1,
  299. type: "solid",
  300. },
  301. },
  302. legend: [{
  303. left: '20%',
  304. orient: 'vertical',
  305. data: ['特困人员救助供养人数(人)', '发放救助金供养金(万元)']
  306. },
  307. {
  308. left: '40%',
  309. orient: 'vertical',
  310. data: ['城市特困人员救助供养人数(人)', '城市发放救助供养金(万元)']
  311. }, {
  312. left: '60%',
  313. orient: 'vertical',
  314. data: ['农村特困人员救助供养人数(人)', '农村发放救助供养金(万元)']
  315. }
  316. ],
  317. tooltip: {
  318. trigger: 'axis',
  319. axisPointer: {
  320. type: 'shadow'
  321. },
  322. backgroundColor: "rgb(0 0 0 / 40%)",
  323. borderColor: 'transparent',
  324. textStyle: {
  325. color: '#fff'
  326. },
  327. },
  328. dataset: {
  329. source: jsonData2
  330. },
  331. xAxis: {
  332. type: 'category',
  333. axisTick: {
  334. show: true //坐标轴刻度线
  335. },
  336. axisLine: { //轴线
  337. show: true
  338. },
  339. splitLine: { //网格线
  340. show: true
  341. },
  342. axisLabel: {
  343. show: true,
  344. textStyle: {
  345. color: '#333', //更改坐标轴文字颜色
  346. fontSize: 14 //更改坐标轴文字大小
  347. }
  348. }
  349. },
  350. yAxis: [{
  351. type: 'value',
  352. min: 0,
  353. max: 15000,
  354. interval: 3000,
  355. axisLabel: {
  356. formatter: '{value}(人)'
  357. },
  358. axisTick: {
  359. show: true //坐标轴刻度线
  360. },
  361. axisLine: { //轴线
  362. show: true
  363. },
  364. splitLine: { //网格线
  365. show: true
  366. }
  367. },
  368. {
  369. type: 'value',
  370. min: 0,
  371. max: 10000,
  372. interval: 2000,
  373. axisLabel: {
  374. formatter: '{value}(万元)'
  375. }
  376. }],
  377. series: [{
  378. type: 'bar',
  379. itemStyle: {
  380. color: '#3C8DE6'
  381. }
  382. },
  383. {
  384. yAxisIndex: 1,
  385. type: 'bar',
  386. itemStyle: {
  387. color: '#FAA639'
  388. }
  389. },
  390. {
  391. type: 'bar',
  392. itemStyle: {
  393. color: '#8EC051'
  394. }
  395. },
  396. {
  397. type: 'bar',
  398. yAxisIndex: 1,
  399. itemStyle: {
  400. color: '#27C2C1'
  401. }
  402. },
  403. {
  404. type: 'bar',
  405. itemStyle: {
  406. color: '#4DC4E7'
  407. }
  408. },
  409. {
  410. type: 'bar',
  411. yAxisIndex: 1,
  412. itemStyle: {
  413. color: '#FA8A46'
  414. }
  415. },
  416. ]
  417. };
  418. option && myChart.setOption(option);
  419. } else if ($(this).data('type') == 3) {
  420. option = {
  421. grid: {
  422. // 网格线配置
  423. show: true,
  424. lineStyle: {
  425. color: ["#e9e9e9"],
  426. width: 1,
  427. type: "solid",
  428. },
  429. },
  430. legend: [{
  431. left: '40%',
  432. orient: 'vertical',
  433. data: ['临时救助人数(人)', '发放金额(万元)']
  434. }
  435. ],
  436. tooltip: {
  437. trigger: 'axis',
  438. axisPointer: {
  439. type: 'shadow'
  440. },
  441. backgroundColor: "rgb(0 0 0 / 40%)",
  442. borderColor: 'transparent',
  443. textStyle: {
  444. color: '#fff'
  445. },
  446. },
  447. dataset: {
  448. source: jsonData3
  449. },
  450. xAxis: {
  451. type: 'category',
  452. axisTick: {
  453. show: true //坐标轴刻度线
  454. },
  455. axisLine: { //轴线
  456. show: true
  457. },
  458. splitLine: { //网格线
  459. show: true
  460. },
  461. axisLabel: {
  462. show: true,
  463. textStyle: {
  464. color: '#333', //更改坐标轴文字颜色
  465. fontSize: 14 //更改坐标轴文字大小
  466. }
  467. }
  468. },
  469. yAxis: [{
  470. type: 'value',
  471. min: 0,
  472. max: 15000,
  473. interval: 3000,
  474. axisLabel: {
  475. formatter: '{value}(人)'
  476. },
  477. axisTick: {
  478. show: true //坐标轴刻度线
  479. },
  480. axisLine: { //轴线
  481. show: true
  482. },
  483. splitLine: { //网格线
  484. show: true
  485. }
  486. },
  487. {
  488. type: 'value',
  489. min: 0,
  490. max: 10000,
  491. interval: 2000,
  492. axisLabel: {
  493. formatter: '{value}(万元)'
  494. }
  495. }],
  496. series: [{
  497. type: 'bar',
  498. itemStyle: {
  499. color: '#3C8DE6'
  500. }
  501. },
  502. {
  503. yAxisIndex: 1,
  504. type: 'bar',
  505. itemStyle: {
  506. color: '#FAA639'
  507. }
  508. },
  509. {
  510. type: 'bar',
  511. itemStyle: {
  512. color: '#8EC051'
  513. }
  514. },
  515. {
  516. type: 'bar',
  517. yAxisIndex: 1,
  518. itemStyle: {
  519. color: '#27C2C1'
  520. }
  521. },
  522. {
  523. type: 'bar',
  524. itemStyle: {
  525. color: '#4DC4E7'
  526. }
  527. },
  528. {
  529. type: 'bar',
  530. yAxisIndex: 1,
  531. itemStyle: {
  532. color: '#FA8A46'
  533. }
  534. },
  535. ]
  536. };
  537. option && myChart.setOption(option);
  538. }
  539. })