diff --git a/core/core-frontend/src/views/chart/components/js/extremumUitl.ts b/core/core-frontend/src/views/chart/components/js/extremumUitl.ts index 8fcba910dd..7fd7f5b29a 100644 --- a/core/core-frontend/src/views/chart/components/js/extremumUitl.ts +++ b/core/core-frontend/src/views/chart/components/js/extremumUitl.ts @@ -104,8 +104,10 @@ const noChildrenFieldChart = chart => { export const extremumEvt = (newChart, chart, _options, container) => { chart.container = container - newChart.on('afterrender', ev => { - createExtremumPoint(chart, ev) + newChart.on('beforerender', ev => { + newChart.chart.geometries[0].on('beforerenderlabel', () => { + createExtremumPoint(chart, ev) + }) }) } @@ -158,6 +160,8 @@ export const createExtremumPoint = (chart, ev) => { if (pointObjList && pointObjList.length > 0) { const pointObj = pointObjList[0] const { minItem, maxItem } = findMinMax(pointObjList.reverse()) + minItem._origin.EXTREME = true + maxItem._origin.EXTREME = true let attr let showExtremum = false if (noChildrenFieldChart(chart) || yAxis.length > 1) { 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 2a78ab9aa0..63df539e27 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 @@ -132,6 +132,9 @@ export class Bar extends G2PlotChartView { fields: [], ...tmpOptions.label, formatter: (data: Datum, _point) => { + if (data.EXTREME) { + return '' + } if (!labelAttr.seriesLabelFormatter?.length) { return data.value }