diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/funnel.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/funnel.ts index 6e2508b04d..39beb3d0a0 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/funnel.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/funnel.ts @@ -125,7 +125,7 @@ export class Funnel extends G2PlotChartView { )(chart, options) } setupDefaultOptions(chart: ChartObj): ChartObj { - const { customAttr } = chart + const { customAttr, customStyle } = chart const { label } = customAttr if (!['left', 'middle', 'right'].includes(label.position)) { label.position = 'middle' @@ -134,6 +134,8 @@ export class Funnel extends G2PlotChartView { ...label, show: true } + const { legend } = customStyle + legend.show = false return chart } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/treemap.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/treemap.ts index 183e178b1f..4dd3e81e85 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/treemap.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/treemap.ts @@ -201,7 +201,7 @@ export class Treemap extends G2PlotChartView { } setupDefaultOptions(chart: ChartObj): ChartObj { - const customAttr = chart.customAttr + const { customAttr, customStyle } = chart const { label } = customAttr customAttr.label = { ...label, @@ -210,6 +210,8 @@ export class Treemap extends G2PlotChartView { showProportion: true, reserveDecimalCount: 2 } + const { legend } = customStyle + legend.show = false return chart } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/pie.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/pie.ts index d01b48dc62..18ef84cdf4 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/pie.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/pie.ts @@ -218,7 +218,7 @@ export class Pie extends G2PlotChartView { } } setupDefaultOptions(chart: ChartObj): ChartObj { - const customAttr = chart.customAttr + const { customAttr, customStyle } = chart const { label } = customAttr if (!['inner', 'outer'].includes(label.position)) { label.position = 'outer' @@ -230,6 +230,8 @@ export class Pie extends G2PlotChartView { showProportion: true, reserveDecimalCount: 2 } + const { legend } = customStyle + legend.show = false return chart } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/rose.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/rose.ts index 3916a3ab75..4fd1846860 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/rose.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/rose.ts @@ -203,7 +203,7 @@ export class Rose extends G2PlotChartView { } setupDefaultOptions(chart: ChartObj): ChartObj { - const customAttr = chart.customAttr + const { customAttr, customStyle } = chart const { label } = customAttr if (!['inner', 'outer'].includes(label.position)) { label.position = 'outer' @@ -215,6 +215,8 @@ export class Rose extends G2PlotChartView { showProportion: true, reserveDecimalCount: 2 } + const { legend } = customStyle + legend.show = false return chart }