diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts index 17ab2ca800..8bb686b50e 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts @@ -97,6 +97,7 @@ export class Bar extends G2PlotChartView { async drawChart(drawOptions: G2PlotDrawOptions): Promise { const { chart, container, action } = drawOptions if (!chart?.data?.data?.length) { + chart.container = container clearExtremum(chart) return } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts index ec8e71b19e..ad002acae1 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts @@ -98,6 +98,7 @@ export class Area extends G2PlotChartView { async drawChart(drawOptions: G2PlotDrawOptions): Promise { const { chart, container, action } = drawOptions if (!chart.data?.data?.length) { + chart.container = container clearExtremum(chart) return } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts index cc601921a3..5432140a63 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts @@ -50,6 +50,7 @@ export class Line extends G2PlotChartView { async drawChart(drawOptions: G2PlotDrawOptions): Promise { const { chart, action, container } = drawOptions if (!chart.data?.data?.length) { + chart.container = container clearExtremum(chart) return }