水电费用.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. var myChart = echarts.init(document.getElementById('aleftboxtbott'));
  2. option = {
  3. color: ['#7ecef4'],
  4. backgroundColor: 'rgba(1,202,217,.2)',
  5. title: {
  6. top: 5,
  7. left: 20,
  8. textStyle: {
  9. fontSize: 10,
  10. color: 'rgba(255,255,255,.6)'
  11. },
  12. text: '环比类型:月环比'
  13. },
  14. legend: {
  15. right: 10,
  16. top: 5,
  17. textStyle: {
  18. fontSize: 10,
  19. color: 'rgba(255,255,255,.6)'
  20. },
  21. data: ['2020年5月', '2020年6月']
  22. },
  23. grid: {
  24. left: 20,
  25. right: 20,
  26. top: 30,
  27. bottom: 2,
  28. containLabel: true
  29. },
  30. xAxis: {
  31. type: 'value',
  32. axisLine: {
  33. lineStyle: {
  34. color: 'rgba(255,255,255,.2)'
  35. }
  36. },
  37. splitLine: {
  38. lineStyle: {
  39. color: 'rgba(255,255,255,0)'
  40. }
  41. },
  42. axisLabel: {
  43. color: "rgba(255,255,255,0)"
  44. },
  45. boundaryGap: [0, 0.01]
  46. },
  47. yAxis: {
  48. type: 'category',
  49. axisLine: {
  50. lineStyle: {
  51. color: 'rgba(255,255,255,.5)'
  52. }
  53. },
  54. splitLine: {
  55. lineStyle: {
  56. color: 'rgba(255,255,255,.1)'
  57. }
  58. },
  59. axisLabel: {
  60. color: "rgba(255,255,255,.5)"
  61. },
  62. data: ['用水量 (m³)', '用电量 (°)', '水费 (元)', '电费 (元)']
  63. },
  64. series: [{
  65. name: '2020年5月',
  66. type: 'bar',
  67. barWidth: 15,
  68. label: {
  69. show: true,
  70. position: 'inside'
  71. },
  72. itemStyle: {
  73. normal: {
  74. color: new echarts.graphic.LinearGradient(
  75. 1, 0, 0, 1, [{
  76. offset: 0,
  77. color: 'rgba(77,114,217,.7)'
  78. }, {
  79. offset: 1,
  80. color: 'rgba(117,72,159,.7'
  81. }]
  82. )
  83. }
  84. },
  85. data: [18203, 23489, 29034, 39098]
  86. }, {
  87. name: '2020年6月',
  88. type: 'bar',
  89. barWidth: 15,
  90. label: {
  91. show: true,
  92. position: 'inside'
  93. },
  94. itemStyle: {
  95. normal: {
  96. color: new echarts.graphic.LinearGradient(
  97. 1, 0, 0, 1, [{
  98. offset: 0,
  99. color: 'rgba(230,253,139,.7)'
  100. }, {
  101. offset: 1,
  102. color: 'rgba(41,220,205,.7)'
  103. }]
  104. )
  105. }
  106. },
  107. data: [19203, 24489, 30034, 40098]
  108. }]
  109. };
  110. myChart.setOption(option);