VisitAnalysis.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <div ref="chartRef" :style="{ height, width }"></div>
  3. </template>
  4. <script lang="ts">
  5. import { defineComponent, onMounted, ref, Ref } from 'vue';
  6. import { useECharts } from '/@/hooks/web/useECharts/index';
  7. import { basicProps } from './props';
  8. export default defineComponent({
  9. props: basicProps,
  10. setup() {
  11. const chartRef = ref<HTMLDivElement | null>(null);
  12. const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
  13. onMounted(() => {
  14. setOptions({
  15. tooltip: {
  16. trigger: 'axis',
  17. axisPointer: {
  18. lineStyle: {
  19. width: 1,
  20. color: '#019680',
  21. },
  22. },
  23. },
  24. xAxis: {
  25. type: 'category',
  26. boundaryGap: false,
  27. data: [
  28. '6:00',
  29. '7:00',
  30. '8:00',
  31. '9:00',
  32. '10:00',
  33. '11:00',
  34. '12:00',
  35. '13:00',
  36. '14:00',
  37. '15:00',
  38. '16:00',
  39. '17:00',
  40. '18:00',
  41. '19:00',
  42. '20:00',
  43. '21:00',
  44. '22:00',
  45. '23:00',
  46. ],
  47. splitLine: {
  48. show: true,
  49. lineStyle: {
  50. width: 1,
  51. type: 'solid',
  52. color: 'rgba(226,226,226,0.5)',
  53. },
  54. },
  55. axisTick: {
  56. show: false,
  57. },
  58. },
  59. yAxis: [
  60. {
  61. type: 'value',
  62. max: 80000,
  63. splitNumber: 4,
  64. axisTick: {
  65. show: false,
  66. },
  67. splitArea: {
  68. show: true,
  69. areaStyle: {
  70. color: ['rgba(255,255,255,0.2)', 'rgba(226,226,226,0.2)'],
  71. },
  72. },
  73. },
  74. ],
  75. grid: { left: '1%', right: '1%', top: '2 %', bottom: 0, containLabel: true },
  76. series: [
  77. {
  78. smooth: true,
  79. data: [
  80. 111,
  81. 222,
  82. 4000,
  83. 18000,
  84. 33333,
  85. 55555,
  86. 66666,
  87. 33333,
  88. 14000,
  89. 36000,
  90. 66666,
  91. 44444,
  92. 22222,
  93. 11111,
  94. 4000,
  95. 2000,
  96. 500,
  97. 333,
  98. 222,
  99. 111,
  100. ],
  101. type: 'line',
  102. areaStyle: {},
  103. itemStyle: {
  104. color: '#5ab1ef',
  105. },
  106. },
  107. {
  108. smooth: true,
  109. data: [
  110. 33,
  111. 66,
  112. 88,
  113. 333,
  114. 3333,
  115. 5000,
  116. 18000,
  117. 3000,
  118. 1200,
  119. 13000,
  120. 22000,
  121. 11000,
  122. 2221,
  123. 1201,
  124. 390,
  125. 198,
  126. 60,
  127. 30,
  128. 22,
  129. 11,
  130. ],
  131. type: 'line',
  132. areaStyle: {},
  133. itemStyle: {
  134. color: '#019680',
  135. },
  136. },
  137. ],
  138. });
  139. });
  140. return { chartRef };
  141. },
  142. });
  143. </script>