insuranceCharts.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. var leftChart1 = function(options){
  2. var series0data = options.series[0].data || [];
  3. var xAxisData = options.xAxis[0].data;
  4. var option = {
  5. "title": {
  6. "text": "医保支出费用月趋势",
  7. "x": "center",
  8. "textStyle": {
  9. color: ['#b5e1fc']
  10. },
  11. "padding": [15, 0, 0, 0]
  12. },
  13. "tooltip": {
  14. "trigger": "axis"
  15. },
  16. grid: {
  17. top: 80,
  18. bottom: 30,
  19. left: 80
  20. },
  21. "yAxis": [{
  22. "type": "value",
  23. "name": "元",
  24. axisPointer: {
  25. type: 'shadow'
  26. },
  27. axisTick: {
  28. // show: false
  29. },
  30. axisLine: {
  31. lineStyle: {
  32. color: '#095f8e'
  33. }
  34. },
  35. axisLabel: {
  36. color: '#b5e1fc'
  37. },
  38. splitLine: {
  39. lineStyle:{
  40. color:'#004b7a'
  41. },
  42. show:true // false不显示坐标轴刻度
  43. }
  44. }],
  45. "xAxis": [{
  46. "type": "category",
  47. axisPointer: {
  48. type: 'shadow'
  49. },
  50. axisTick: {
  51. // show: false
  52. },
  53. axisLine: {
  54. lineStyle: {
  55. color: '#004b7a'
  56. }
  57. },
  58. axisLabel: {
  59. color: '#b5e1fc'
  60. },
  61. nameTextStyle: {
  62. color: '#b5e1fc'
  63. },
  64. "data": xAxisData,
  65. }],
  66. "series": [{
  67. "smooth": true,
  68. "name": "区县分布",
  69. "type": "line",
  70. barWidth: 20,
  71. "label": {
  72. show: false,
  73. position: "right"
  74. },
  75. "itemStyle": {
  76. "normal": {
  77. "lineStyle": {
  78. "shadowColor": "rgba(0,0,0,0.4)"
  79. },
  80. barBorderRadius: [0, 8, 8, 0],
  81. color: '#03fa6c'
  82. }
  83. },
  84. "data": series0data
  85. }, ]
  86. }
  87. return option
  88. },
  89. leftChart2 = function(options){
  90. var title = options.title.text;
  91. var data = options.series[0].data;
  92. var legend = data.map(function(item){
  93. return item.name;
  94. })
  95. var option = {
  96. "title": {
  97. "text": title,
  98. "x": "center",
  99. "textStyle": {
  100. color: ['#b5e1fc']
  101. },
  102. "padding": [15, 0, 0, 0]
  103. },
  104. "tooltip": {
  105. "trigger": "item"
  106. },
  107. legend: {
  108. orient: 'vertical',
  109. // x: 'right',
  110. data:legend,
  111. right: '45%',
  112. bottom: '50%',
  113. textStyle: {
  114. color: ['#b5e1fc']
  115. }
  116. },
  117. "series": [{
  118. "center": ["50%", "50%"],
  119. "radius": ['45%', '55%'],
  120. "name": "",
  121. "type": "pie",
  122. "itemStyle": {
  123. "normal": {
  124. "label": {
  125. "show": false
  126. },
  127. "labelLine": {
  128. "show": false
  129. }
  130. }
  131. },
  132. "data": data
  133. }],
  134. color : ["#00e6f3","#ff616f","#ff616f","#0fa5f2","#00e6f3"]
  135. }
  136. return option
  137. },
  138. leftChart3 = function(options){
  139. var title = options.title.text;
  140. var xAxisData = options.xAxis[0].data;
  141. var series0data = options.series[0].data || [];
  142. var option = {
  143. "title": {
  144. "text": title,
  145. "x": "center",
  146. textStyle: {
  147. color: '#b5e1fc',
  148. fontSize: 16,
  149. fontWeight: 'bold'
  150. },
  151. "padding": [17, 0, 0, 0]
  152. },
  153. "grid": {
  154. top: '90',
  155. left: '70',
  156. bottom:'25',
  157. right:'40'
  158. },
  159. xAxis: [{
  160. type: 'category',
  161. "data": xAxisData,
  162. axisPointer: {
  163. type: 'shadow'
  164. },
  165. axisTick: {
  166. show: false
  167. },
  168. axisLine: {
  169. lineStyle: {
  170. color: '#095f8e'
  171. }
  172. },
  173. axisLabel: {
  174. color: '#b5e1fc'
  175. }
  176. }],
  177. yAxis: [{
  178. type: 'value',
  179. name: '元',
  180. nameTextStyle: {
  181. color: '#b5e1fc' // 坐标轴名称颜色
  182. },
  183. splitLine: {
  184. show: false
  185. },
  186. axisLine: {
  187. lineStyle: {
  188. color: '#095f8e'
  189. }
  190. },
  191. axisLabel: {
  192. color: '#b5e1fc'
  193. }
  194. }
  195. ],
  196. series: [{
  197. name: '元',
  198. type: 'bar',
  199. "data":series0data,
  200. barWidth: 20,
  201. label: {
  202. normal: {
  203. show: true,
  204. position: 'top', // 在柱状图上方显示
  205. color: '#fff' // 柱状图上方显示的数值颜色
  206. }
  207. },
  208. itemStyle: {
  209. barBorderRadius: [8, 8, 0, 0],
  210. color: '#00e6f3'
  211. }
  212. }
  213. ]
  214. }
  215. return option
  216. }