调整使用趋势
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user