From 8759438ca3812168f1157d3434931624d14531fd Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期五, 27 九月 2024 17:07:29 +0800 Subject: [PATCH] 图表初始化bug --- src/views/home/data-video/index.vue | 6 +++--- src/views/home/data-face/index.vue | 5 +++-- src/views/home/data-car/index.vue | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/views/home/data-car/index.vue b/src/views/home/data-car/index.vue index c50f199..af1c1a7 100644 --- a/src/views/home/data-car/index.vue +++ b/src/views/home/data-car/index.vue @@ -28,8 +28,7 @@ import * as echarts from 'echarts'; import {car} from "../../../api/platform/home"; -var chartDom = document.getElementById('main'); -var myChart = echarts.init(chartDom); +var myChart = null; var option; let observer = null; export default { @@ -275,6 +274,7 @@ const month = (date.getMonth() + 1) >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1); this.date = year + '-' + month; this.params.date = this.date; + myChart = echarts.init(this.$refs.chartContent); this.getChart(); this.observe(); }, diff --git a/src/views/home/data-face/index.vue b/src/views/home/data-face/index.vue index ae50412..a81bb08 100644 --- a/src/views/home/data-face/index.vue +++ b/src/views/home/data-face/index.vue @@ -28,8 +28,8 @@ import * as echarts from 'echarts'; import {car, face} from "../../../api/platform/home"; -var chartDom = document.getElementById('main'); -var myChart = echarts.init(chartDom); + +var myChart = null; var option; let observer = null; export default { @@ -276,6 +276,7 @@ const month = (date.getMonth() + 1) >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1); this.date = year + '-' + month; this.params.date = this.date; + myChart = echarts.init(this.$refs.chartContent); this.getChart(); this.observe(); }, diff --git a/src/views/home/data-video/index.vue b/src/views/home/data-video/index.vue index 47febe7..b152a69 100644 --- a/src/views/home/data-video/index.vue +++ b/src/views/home/data-video/index.vue @@ -27,8 +27,7 @@ <script> import * as echarts from 'echarts'; import {video} from "../../../api/platform/home"; -var chartDom = document.getElementById('main'); -var myChart = echarts.init(chartDom); +var myChart =null; var option; let observer = null; export default { @@ -122,7 +121,7 @@ </div>`; }).join(''); tooltipHtml = `${tooltipHtml}${pointsHtml}`; - tooltipHtml += `<div style="font-weight: bold; margin-top: 10px;padding:0 12px;">褰曞儚姝e父鍙傝�冨��: ${baseLine.toLocaleString()}</div>`; + tooltipHtml += `<div style="font-weight: bold; margin-top: 10px;padding:0 12px;">褰曞儚瀹屾暣鍙傝�冨��: ${baseLine.toLocaleString()}</div>`; return tooltipHtml; } @@ -260,6 +259,7 @@ const month = (date.getMonth() + 1) >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1); this.date = year + '-' + month; this.params.date = this.date; + myChart = echarts.init(this.$refs.chartContent); this.getChart(); this.observe(); }, -- Gitblit v1.8.0