NCDindex.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. var symptomName = last_month_day();
  2. $(function(){
  3. init();
  4. })
  5. function init(){
  6. //地图
  7. var mapChart = echarts.init(document.getElementById('mapChart'));
  8. mapChart.setOption({
  9. bmap: {
  10. center: [118.096435,24.485408],
  11. zoom: 12,
  12. roam: true,
  13. },
  14. tooltip : {
  15. trigger: 'item',
  16. formatter:function(params, ticket, callback){
  17. return params.value[2]
  18. }
  19. },
  20. series: [{
  21. type: 'scatter',
  22. coordinateSystem: 'bmap',
  23. data: [
  24. [118.096435, 24.485408, '厦门市'] ,
  25. [118.094564, 24.457358, '厦门第一医院'] ,
  26. [118.104103, 24.477761, '厦门中山医院'],
  27. [118.14748, 24.506295, '厦门中医院'],
  28. [118.254841, 24.665349, '厦门第五医院'],
  29. ]
  30. }]
  31. });
  32. mapChart.on('click', function (params) {
  33. console.log(params.value[2])
  34. // $("#hospitalName").html(params.value[2]);
  35. // if(params.value[2] == '厦门市'){
  36. // $("#Data").html(100);
  37. // $("#Outpatient").html(20000);
  38. // $("#Hospitalization").html(3000);
  39. // }
  40. // if(params.value[2] == '厦门第一医院'){
  41. // $("#Data").html(40);
  42. // $("#Outpatient").html(8000);
  43. // $("#Hospitalization").html(1200);
  44. // }
  45. // if(params.value[2] == '厦门中山医院'){
  46. // $("#Data").html(30);
  47. // $("#Outpatient").html(6000);
  48. // $("#Hospitalization").html(900);
  49. // }
  50. // if(params.value[2] == '厦门中医院'){
  51. // $("#Data").html(20);
  52. // $("#Outpatient").html(4000);
  53. // $("#Hospitalization").html(600);
  54. // }
  55. // if(params.value[2] == '厦门第五医院'){
  56. // $("#Data").html(10);
  57. // $("#Outpatient").html(2000);
  58. // $("#Hospitalization").html(300);
  59. // }
  60. });
  61. var bmap = mapChart.getModel().getComponent('bmap').getBMap()
  62. bmap.addControl(new BMap.MapTypeControl({mapTypes: [BMAP_NORMAL_MAP,BMAP_SATELLITE_MAP ]}));
  63. bmap.setMapStyle({style:'midnight'})
  64. var pieChart = echarts.init(document.getElementById('pieChart'));
  65. pieChart.setOption({
  66. color:["#87cefa","#ff7f50","#32cd32","#da70d6","#FD6C88"],
  67. legend: {
  68. y : '260',
  69. x : 'center',
  70. textStyle : {
  71. color : '#ffffff',
  72. },
  73. data : ['高血压','糖尿病','脑卒中','慢阻肺','慢性肾病'],
  74. },
  75. tooltip : {
  76. trigger: 'item',
  77. formatter: "{a}<br/>{b}<br/>{c}G ({d}%)"
  78. },
  79. calculable : false,
  80. series : [
  81. {
  82. name:'采集数据量',
  83. type:'pie',
  84. radius : ['40%', '70%'],
  85. center : ['50%', '45%'],
  86. itemStyle : {
  87. normal : {
  88. label : {
  89. show : false
  90. },
  91. labelLine : {
  92. show : false
  93. }
  94. },
  95. emphasis : {
  96. label : {
  97. show : true,
  98. position : 'center',
  99. textStyle : {
  100. fontSize : '20',
  101. fontWeight : 'bold'
  102. }
  103. }
  104. }
  105. },
  106. data:[
  107. {value:335, name:'高血压'},
  108. {value:310, name:'糖尿病'},
  109. {value:234, name:'脑卒中'},
  110. {value:135, name:'慢阻肺'},
  111. {value:235, name:'慢性肾病'}
  112. ]
  113. }
  114. ]
  115. });
  116. var lineChart = echarts.init(document.getElementById('lineChart'));
  117. lineChart.setOption({
  118. color:["#87cefa","#ff7f50","#32cd32","#da70d6",],
  119. legend: {
  120. y : '260',
  121. x : 'center',
  122. textStyle : {
  123. color : '#ffffff',
  124. },
  125. data : ['厦门第一医院','厦门中山医院','厦门中医院','厦门第五医院',],
  126. },
  127. calculable : false,
  128. tooltip : {
  129. trigger: 'item',
  130. formatter: "{a}<br/>{b}<br/>{c}条"
  131. },
  132. yAxis: [
  133. {
  134. type: 'value',
  135. axisLine : {onZero: false},
  136. axisLine:{
  137. lineStyle:{
  138. color: '#034c6a'
  139. },
  140. },
  141. axisLabel: {
  142. textStyle: {
  143. color: '#fff'
  144. },
  145. formatter: function (value) {
  146. return value + "k条"
  147. },
  148. },
  149. splitLine:{
  150. lineStyle:{
  151. width:0,
  152. type:'solid'
  153. }
  154. }
  155. }
  156. ],
  157. xAxis: [
  158. {
  159. type: 'category',
  160. data : ['8:00','10:00','12:00','14:00','16:00','18:00','20:00','22:00'],
  161. axisLine:{
  162. lineStyle:{
  163. color: '#034c6a'
  164. },
  165. },
  166. splitLine: {
  167. "show": false
  168. },
  169. axisLabel: {
  170. textStyle: {
  171. color: '#fff'
  172. },
  173. formatter: function (value) {
  174. return value + ""
  175. },
  176. },
  177. splitLine:{
  178. lineStyle:{
  179. width:0,
  180. type:'solid'
  181. }
  182. },
  183. }
  184. ],
  185. grid:{
  186. left: '5%',
  187. right: '5%',
  188. bottom: '20%',
  189. containLabel: true
  190. },
  191. series : [
  192. {
  193. name:'厦门第一医院',
  194. type:'line',
  195. smooth:true,
  196. itemStyle: {
  197. normal: {
  198. lineStyle: {
  199. shadowColor : 'rgba(0,0,0,0.4)'
  200. }
  201. }
  202. },
  203. data:[15, 0, 20, 45, 22.1, 25, 70, 55, 76]
  204. },
  205. {
  206. name:'厦门中山医院',
  207. type:'line',
  208. smooth:true,
  209. itemStyle: {
  210. normal: {
  211. lineStyle: {
  212. shadowColor : 'rgba(0,0,0,0.4)'
  213. }
  214. }
  215. },
  216. data:[25, 10, 30, 55, 32.1, 35, 80, 65, 76]
  217. },
  218. {
  219. name:'厦门中医院',
  220. type:'line',
  221. smooth:true,
  222. itemStyle: {
  223. normal: {
  224. lineStyle: {
  225. shadowColor : 'rgba(0,0,0,0.4)'
  226. }
  227. }
  228. },
  229. data:[35, 20, 40, 65, 42.1, 45, 90, 75, 96]
  230. },
  231. {
  232. name:'厦门第五医院',
  233. type:'line',
  234. smooth:true,
  235. itemStyle: {
  236. normal: {
  237. lineStyle: {
  238. shadowColor : 'rgba(0,0,0,0.4)'
  239. }
  240. }
  241. },
  242. data:[45, 30, 50, 75, 52.1, 55, 100, 85, 106]
  243. }
  244. ]
  245. });
  246. var histogramChart = echarts.init(document.getElementById('histogramChart'));
  247. histogramChart.setOption({
  248. color:["#87cefa","#ff7f50","#32cd32","#da70d6",],
  249. legend: {
  250. y : '250',
  251. x : 'center',
  252. data:['厦门第一医院', '厦门中山医院','厦门中医院','厦门第五医院'],
  253. textStyle : {
  254. color : '#ffffff',
  255. }
  256. },
  257. calculable :false,
  258. grid:{
  259. left: '5%',
  260. right: '5%',
  261. bottom: '20%',
  262. containLabel: true
  263. },
  264. tooltip : {
  265. trigger: 'axis',
  266. axisPointer : {
  267. type : 'shadow'
  268. }
  269. },
  270. xAxis : [
  271. {
  272. type : 'value',
  273. axisLabel: {
  274. show: true,
  275. textStyle: {
  276. color: '#fff'
  277. }
  278. },
  279. splitLine:{
  280. lineStyle:{
  281. color:['#f2f2f2'],
  282. width:0,
  283. type:'solid'
  284. }
  285. }
  286. }
  287. ],
  288. yAxis : [
  289. {
  290. type : 'category',
  291. data:['门诊人数(人)', '住院人次(人)','人均费用(元)'],
  292. axisLabel: {
  293. show: true,
  294. textStyle: {
  295. color: '#fff'
  296. }
  297. },
  298. splitLine:{
  299. lineStyle:{
  300. width:0,
  301. type:'solid'
  302. }
  303. }
  304. }
  305. ],
  306. series : [
  307. {
  308. name:'厦门第一医院',
  309. type:'bar',
  310. stack: '总量',
  311. itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
  312. data:[320, 302, 301]
  313. },
  314. {
  315. name:'厦门中山医院',
  316. type:'bar',
  317. stack: '总量',
  318. itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
  319. data:[120, 132, 101]
  320. },
  321. {
  322. name:'厦门中医院',
  323. type:'bar',
  324. stack: '总量',
  325. itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
  326. data:[220, 182, 191]
  327. },
  328. {
  329. name:'厦门第五医院',
  330. type:'bar',
  331. stack: '总量',
  332. itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
  333. data:[150, 212, 201]
  334. }
  335. ]
  336. });
  337. var lineChart2 = echarts.init(document.getElementById('lineChart2'));
  338. lineChart2.setOption({
  339. color:["#87cefa","#ff7f50","#32cd32","#da70d6",],
  340. legend: {
  341. y : '260',
  342. x : 'center',
  343. textStyle : {
  344. color : '#ffffff',
  345. },
  346. data : ['厦门第一医院','厦门中山医院','厦门中医院','厦门第五医院',],
  347. },
  348. calculable : false,
  349. tooltip : {
  350. trigger: 'item',
  351. formatter: "{a}<br/>{b}<br/>{c}条"
  352. },
  353. yAxis: [
  354. {
  355. type: 'value',
  356. axisLine : {onZero: false},
  357. axisLine:{
  358. lineStyle:{
  359. color: '#034c6a'
  360. },
  361. },
  362. axisLabel: {
  363. textStyle: {
  364. color: '#fff'
  365. },
  366. formatter: function (value) {
  367. return value + "条"
  368. },
  369. },
  370. splitLine:{
  371. lineStyle:{
  372. width:0,
  373. type:'solid'
  374. }
  375. }
  376. }
  377. ],
  378. xAxis: [
  379. {
  380. type: 'category',
  381. data : ['8:00','10:00','12:00','14:00','16:00','18:00'],
  382. axisLine:{
  383. lineStyle:{
  384. color: '#034c6a'
  385. },
  386. },
  387. splitLine: {
  388. "show": false
  389. },
  390. axisLabel: {
  391. textStyle: {
  392. color: '#fff'
  393. },
  394. formatter: function (value) {
  395. return value + ""
  396. },
  397. },
  398. splitLine:{
  399. lineStyle:{
  400. width:0,
  401. type:'solid'
  402. }
  403. },
  404. }
  405. ],
  406. grid:{
  407. left: '5%',
  408. right: '5%',
  409. bottom: '20%',
  410. containLabel: true
  411. },
  412. series : [
  413. {
  414. name:'厦门第一医院',
  415. type:'line',
  416. smooth:true,
  417. itemStyle: {
  418. normal: {
  419. lineStyle: {
  420. shadowColor : 'rgba(0,0,0,0.4)'
  421. }
  422. }
  423. },
  424. data:[15, 0, 20, 45, 22.1, 25,].reverse()
  425. },
  426. {
  427. name:'厦门中山医院',
  428. type:'line',
  429. smooth:true,
  430. itemStyle: {
  431. normal: {
  432. lineStyle: {
  433. shadowColor : 'rgba(0,0,0,0.4)'
  434. }
  435. }
  436. },
  437. data:[25, 10, 30, 55, 32.1, 35, ].reverse()
  438. },
  439. {
  440. name:'厦门中医院',
  441. type:'line',
  442. smooth:true,
  443. itemStyle: {
  444. normal: {
  445. lineStyle: {
  446. shadowColor : 'rgba(0,0,0,0.4)'
  447. }
  448. }
  449. },
  450. data:[35, 20, 40, 65, 42.1, 45, ].reverse()
  451. },
  452. {
  453. name:'厦门第五医院',
  454. type:'line',
  455. smooth:true,
  456. itemStyle: {
  457. normal: {
  458. lineStyle: {
  459. shadowColor : 'rgba(0,0,0,0.4)'
  460. }
  461. }
  462. },
  463. data:[45, 30, 50, 75, 52.1, 55, 6].reverse()
  464. }
  465. ]
  466. });
  467. }