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 15a7b793bd..ec8e71b19e 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 @@ -97,7 +97,7 @@ export class Area extends G2PlotChartView { async drawChart(drawOptions: G2PlotDrawOptions): Promise { const { chart, container, action } = drawOptions - if (!chart.data.data?.length) { + if (!chart.data?.data?.length) { 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 54ebb74e65..737a121a6c 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 @@ -49,7 +49,7 @@ export class Line extends G2PlotChartView { } async drawChart(drawOptions: G2PlotDrawOptions): Promise { const { chart, action, container } = drawOptions - if (!chart.data.data?.length) { + if (!chart.data?.data?.length) { clearExtremum(chart) return } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/line/stock-line.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/line/stock-line.ts index 88cb4b982f..60138ebb2c 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/line/stock-line.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/line/stock-line.ts @@ -212,7 +212,7 @@ export class StockLine extends G2PlotChartView { async drawChart(drawOptions: G2PlotDrawOptions): Promise { const { chart, action, container } = drawOptions - if (!chart.data.data?.length) { + if (!chart.data?.data?.length) { return } const xAxis = chart.xAxis