diff --git a/core/frontend/src/components/canvas/customComponent/UserView.vue b/core/frontend/src/components/canvas/customComponent/UserView.vue index ea961a8db9..eb90163773 100644 --- a/core/frontend/src/components/canvas/customComponent/UserView.vue +++ b/core/frontend/src/components/canvas/customComponent/UserView.vue @@ -655,6 +655,7 @@ export default { tabSwitch(tabCanvasId) { if (this.charViewS2ShowFlag && tabCanvasId === this.canvasId && this.$refs[this.element.propValue.id]) { // do nothing + this.$refs[this.element.propValue.id].chartResize() } }, // 编辑状态下 不启动刷新 diff --git a/core/frontend/src/views/chart/components/ChartComponentS2.vue b/core/frontend/src/views/chart/components/ChartComponentS2.vue index ae96b11a25..4b4243c187 100644 --- a/core/frontend/src/views/chart/components/ChartComponentS2.vue +++ b/core/frontend/src/views/chart/components/ChartComponentS2.vue @@ -396,7 +396,8 @@ export default { const { width: chartWidth, height: chartHeight } = this.myChart.options if (width !== chartWidth || height !== chartHeight) { this.myChart?.changeSheetSize(width, height) - if (chartWidth || chartHeight) { + // 大小变化或者tab变化重新渲染 + if (chartWidth || chartHeight || !(chartHeight || chartWidth)) { this.myChart.render() } this.initScroll()