From b677756509f47a635659c4c9ca69c06ca10131e3 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Wed, 3 Jun 2026 15:14:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=9B=B7=E8=BE=BE=E5=9B=BE=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A1=AE=E4=BF=9D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=AD=A3=E7=A1=AE=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/panel/charts/g2/distribution/radar.ts | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/distribution/radar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/distribution/radar.ts index 46d8bfd6d4..4bc620da2b 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/distribution/radar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/distribution/radar.ts @@ -103,18 +103,24 @@ export class Radar extends G2ChartView { const newChart = new G2Chart({ container }) handleChartDashboardHidden(chart, options) newChart.options(options) - newChart.on('point:click', action) - if (options.children[0].labels?.length) { - newChart.on('label:click', e => { - action({ - x: e.x, - y: e.y, - data: { - data: e.target.attrs.data - } - }) + const handleClick = e => { + const pointData = e?.data?.data + if (!pointData) { + return + } + action({ + ...e, + x: e.x, + y: e.y, + data: { + data: pointData + } }) } + newChart.on('point:click', handleClick) + if (options.children[0].labels?.length) { + newChart.on('label:click', handleClick) + } return newChart } @@ -182,8 +188,12 @@ export class Radar extends G2ChartView { if (radarShowPoint) { options.children.push({ + zIndex: 2, type: 'point', encode: { + x: 'field', + y: 'value', + color: 'category', shape: 'point', size: radarPointSize },