From e5d499ae6a4e6b320f71c49987b76cc11f6bc1e4 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 28 十月 2025 14:13:10 +0800
Subject: [PATCH] 首页问题
---
src/views/home/data-chart/index.vue | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/views/home/data-chart/index.vue b/src/views/home/data-chart/index.vue
index 7dc8aec..48f1994 100644
--- a/src/views/home/data-chart/index.vue
+++ b/src/views/home/data-chart/index.vue
@@ -43,6 +43,8 @@
},
methods: {
initChart() {
+ const sortedKeys = Object.keys(this.acitveData.state)
+ .sort(); // 鎸夌収瀛楃涓茬殑瀛楀吀搴忓閿繘琛屾帓搴�
const option = {
legend: {
right: 'right',
@@ -74,13 +76,13 @@
tooltip: {},
xAxis: {
type: 'category',
- data: Object.keys(this.acitveData.state),
+ data: sortedKeys,
},
yAxis: {},
series: [
{
name: '姝e父鏁�',
- data: Object.entries(this.acitveData.state).map(([key, value]) => value),
+ data: sortedKeys.map(key => this.acitveData.state[key]),
type: 'line',
itemStyle: {
color: 'rgba(62, 144, 247, 1)'
@@ -88,7 +90,7 @@
},
{
name: '寮傚父鏁�',
- data: Object.entries(this.acitveData.state2).map(([key, value]) => value),
+ data: sortedKeys.map(key => this.acitveData.state2[key]),
type: 'line',
itemStyle: {
color: 'rgba(85, 192, 191, 1)'
--
Gitblit v1.8.0