소스 검색

perf(Analysis): 优化图表图例及系列名称描述

- 修改 BarChart 组件中图例和系列名称为“预约人次”和“入场人数次”
- 修改 MonthlyLineChart 组件中图例和系列名称为“预约人次”和“入场人次”
- 清理 Line 组件中未使用的导入语句,简化代码依赖
zhangtao 2 일 전
부모
커밋
ea79b74f6a

+ 3 - 3
src/views/dashboard/Analysis/components/BarChart.vue

@@ -23,7 +23,7 @@
       const entries = data.map((item) => item.entryCount || 0);
       setOptions({
         tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
-        legend: { data: ['预约人数', '入场人数'], top: 0 },
+        legend: { data: ['预约人次', '入场人数次'], top: 0 },
         grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
         xAxis: {
           type: 'category',
@@ -32,8 +32,8 @@
         },
         yAxis: { type: 'value' },
         series: [
-          { name: '预约人', type: 'bar', data: reservations, itemStyle: { color: '#4A90D9' }, barGap: '0%' },
-          { name: '入场人数', type: 'bar', data: entries, itemStyle: { color: '#69C0C0' } },
+          { name: '预约人', type: 'bar', data: reservations, itemStyle: { color: '#4A90D9' }, barGap: '0%' },
+          { name: '入场人数', type: 'bar', data: entries, itemStyle: { color: '#69C0C0' } },
         ],
       });
     },

+ 1 - 1
src/views/dashboard/Analysis/components/Line.vue

@@ -2,7 +2,7 @@
   <div ref="chartRef" :style="{ height, width }"></div>
 </template>
 <script lang="ts">
-  import { defineComponent, PropType, ref, Ref, onMounted, nextTick } from 'vue';
+  import { defineComponent, PropType, ref, Ref, onMounted,} from 'vue';
   import { useECharts } from '/@/hooks/web/useECharts';
   import dayjs from 'dayjs';
   function generateCurrentMonthDays(chartData: any[] = []) {

+ 3 - 3
src/views/dashboard/Analysis/components/MonthlyLineChart.vue

@@ -30,13 +30,13 @@
       }
       setOptions({
         tooltip: { trigger: 'axis' },
-        legend: { data: ['预约人数', '入场人数'], top: 0, icon: 'circle' },
+        legend: { data: ['预约人次', '入场人次'], top: 0, icon: 'circle' },
         grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
         xAxis: { type: 'category', data: months, boundaryGap: false },
         yAxis: { type: 'value' },
         series: [
           {
-            name: '预约人',
+            name: '预约人',
             type: 'line',
             data: reservations,
             symbol: 'circle',
@@ -45,7 +45,7 @@
             lineStyle: { color: '#3B9E9E' },
           },
           {
-            name: '入场人',
+            name: '入场人',
             type: 'line',
             data: entries,
             symbol: 'circle',