From aba444f58264a5b6a016ddc3e6076de8e9379950 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期二, 05 十二月 2023 16:29:13 +0800 Subject: [PATCH] 设备超出点点点 --- src/views/cockpitPage/components/DeviceChart.vue | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/src/views/cockpitPage/components/DeviceChart.vue b/src/views/cockpitPage/components/DeviceChart.vue index 530e342..769ce8b 100644 --- a/src/views/cockpitPage/components/DeviceChart.vue +++ b/src/views/cockpitPage/components/DeviceChart.vue @@ -46,6 +46,7 @@ // }, startValue: 0, endValue: 5, + chartTimer:null, }; }, watch: { @@ -64,6 +65,7 @@ //鍦ㄨ亴 pieChart(chartName, data) { let that = this; + clearInterval(this.chartTimer); let chartDomTwo = this.$refs[chartName]; let myChartTwo = echarts.init(chartDomTwo) myChartTwo.dispose() @@ -134,6 +136,12 @@ } }, }, + formatter:function(value){ + if(value.length>6){ + return `${value.slice(0,4)}...` + } + return value; + } }, data: data.datax ? data.datax : [], }, @@ -205,7 +213,7 @@ ], }; - setInterval(function () { + this.chartTimer=setInterval(function () { if (option.dataZoom[0].endValue == data.datay.length) { option.dataZoom[0].startValue = that.startValue; option.dataZoom[0].endValue = that.endValue; -- Gitblit v1.8.0