WaterLevelChart.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <div style="display: inline-block;float:left ;height: 170rem;width: 160rem;">
  3. <jt-echarts style="width: 100%;height: 100%;margin-top:25rem" :chartData="option"></jt-echarts>
  4. </div>
  5. <div class="text">
  6. <div class="left">
  7. <div class="leftTop">15.7亩</div>
  8. <div class="leftMid">灌溉面积</div>
  9. <div class="leftTop">180个</div>
  10. <div class="leftMid">灌溉井数</div>
  11. <div class="leftTop">15.4km</div>
  12. <div class="leftMid">灌溉管网</div>
  13. </div>
  14. <div class="right">
  15. <div class="leftTop">280个</div>
  16. <div class="leftMid">覆盖地块</div>
  17. <div class="leftTop">83条</div>
  18. <div class="leftMid">灌溉水渠</div>
  19. <div class="leftTop">8.9km</div>
  20. <div class="leftMid">排水管网</div>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. option: {}
  29. }
  30. },
  31. created() {},
  32. mounted() {
  33. this.typeCharts()
  34. },
  35. methods: {
  36. typeCharts() {
  37. this.option = this.getOption();
  38. // var chartDom = document.getElementById('echarts');
  39. // var myChart = echarts.init(chartDom);
  40. // myChart.setOption(option, true);
  41. },
  42. getOption(data) {
  43. let option = {
  44. tooltip: {
  45. show: true
  46. },
  47. series: [{
  48. name: '完成',
  49. type: 'liquidFill',
  50. radius: '130rem',
  51. data: [0.80],
  52. label: {
  53. normal: {
  54. color: '#27e5f1',
  55. insideColor: '#fff',
  56. textStyle: {
  57. fontSize: "40rem",
  58. fontWeight: 'bold',
  59. }
  60. }
  61. },
  62. color: [{
  63. type: 'linear',
  64. x: 0,
  65. y: 1,
  66. x2: 0,
  67. y2: 0,
  68. colorStops: [{
  69. offset: 1,
  70. color: ['#6a7feb'], // 0% 处的颜色
  71. }, {
  72. offset: 0,
  73. color: ['#27e5f1'], // 100% 处的颜色
  74. }],
  75. global: false // 缺省为 false
  76. }],
  77. outline: {
  78. show: true,
  79. borderDistance: 5,
  80. itemStyle: {
  81. borderColor: '#27e5f1',
  82. borderWidth: 3
  83. }
  84. }
  85. }]
  86. };
  87. return option;
  88. }
  89. },
  90. }
  91. </script>
  92. <style scoped>
  93. .text {
  94. margin-top: 10rem;
  95. height: 170rem;
  96. width: 165rem;
  97. display: inline-block;
  98. }
  99. .left {
  100. width: 50%;
  101. float: left;
  102. }
  103. .leftTop {
  104. margin-top: 10rem;
  105. color: rgb(200, 250, 255);
  106. font-size: 24rem;
  107. font-weight: bold;
  108. }
  109. .leftMid {
  110. color: rgb(200, 250, 255);
  111. font-size: 16rem;
  112. }
  113. .right {
  114. width: 50%;
  115. float: right;
  116. }
  117. .rightTop {
  118. margin-top: 10rem;
  119. color: rgb(200, 250, 255);
  120. font-size: 24rem;
  121. font-weight: bold;
  122. }
  123. .rightMid {
  124. color: rgb(200, 250, 255);
  125. font-size: 16rem;
  126. }
  127. </style>