insuranceCharts.js 6.4 KB

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