From d176f2eb9ca1cfb588e38663de53cb34725a5694 Mon Sep 17 00:00:00 2001 From: liuwei Date: Fri, 21 Mar 2025 15:17:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BD=BF=E7=94=A8=E8=B6=8B?= =?UTF-8?q?=E5=8A=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/stats_dashboard/templates/index.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/stats_dashboard/templates/index.html b/plugins/stats_dashboard/templates/index.html index aca8966..26142da 100644 --- a/plugins/stats_dashboard/templates/index.html +++ b/plugins/stats_dashboard/templates/index.html @@ -140,7 +140,8 @@ topUsers: [], topGroups: [], topPlugins: [], - pluginStats: [] + pluginStats: [], + charts: {} // 添加charts对象 } }, mounted() { @@ -286,10 +287,15 @@ const ctx = document.getElementById('trendChart').getContext('2d'); // 销毁旧图表 - if (this.charts.trendChart) { + if (this.charts && this.charts.trendChart) { this.charts.trendChart.destroy(); } + // 确保charts对象存在 + if (!this.charts) { + this.charts = {}; + } + // 准备数据 const labels = trendData.map(item => item.stat_date); const totalData = trendData.map(item => item.total_calls); @@ -330,6 +336,7 @@ }, options: { responsive: true, + maintainAspectRatio: false, scales: { y: { beginAtZero: true