From a3b2d94cbfb9bea819346a1b738237f72819a833 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期四, 12 六月 2025 13:35:33 +0800 Subject: [PATCH] 动态溯源(待完成) --- src/components/chart/RealTimeLineChart.vue | 25 +++++++++++++++++++------ 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/components/chart/RealTimeLineChart.vue b/src/components/chart/RealTimeLineChart.vue index 562b60f..a66e2ac 100644 --- a/src/components/chart/RealTimeLineChart.vue +++ b/src/components/chart/RealTimeLineChart.vue @@ -1,6 +1,10 @@ <template> <div class="chart-wrap"> - <div ref="lineChart" class="line-chart"></div> + <div + ref="lineChart" + class="line-chart" + :style="'height:' + chartHeight + ';'" + ></div> </div> </template> <script> @@ -17,6 +21,10 @@ // series: [] // }; // } + }, + chartHeight: { + type: String, + default: '140px' } }, data() { @@ -44,6 +52,7 @@ } if (this.lineChart) { this.lineChart.setOption(this.option, { notMerge: true }); + // console.log('鎶樼嚎鍥剧敓鎴愶細绔嬪嵆'); } else { this.onChartCreated = () => { this.lineChart.setOption(this.option, { notMerge: true }); @@ -53,9 +62,13 @@ }, mounted() { this.lineChart = echarts.init(this.$refs.lineChart); - if (typeof this.onChartCreated === 'function') { - this.onChartCreated(); - } + this.onChartCreated(); + // setTimeout(() => { + // if (typeof this.onChartCreated === 'function') { + // this.onChartCreated(); + // // console.log('鎶樼嚎鍥剧敓鎴愶細婊炲悗'); + // } + // }, 500); } }; </script> @@ -66,8 +79,8 @@ justify-content: center; } .line-chart { - width: 300px; - height: 140px; + width: 318px; + /* height: 140px; */ /* border-bottom: 1px solid rgba(255, 255, 255, 0.329); */ } </style> -- Gitblit v1.9.3