fix(图表): 修复雷达图开启标签之后无法触发联动或跳转事件

This commit is contained in:
wisonic 2025-01-03 16:10:09 +08:00 committed by wisonic-s
parent e79728d554
commit 3ec5577c02

View File

@ -119,6 +119,17 @@ export class Radar extends G2PlotChartView<RadarOptions, G2Radar> {
const { Radar: G2Radar } = await import('@antv/g2plot/esm/plots/radar') const { Radar: G2Radar } = await import('@antv/g2plot/esm/plots/radar')
const newChart = new G2Radar(container, options) const newChart = new G2Radar(container, options)
newChart.on('point:click', action) newChart.on('point:click', action)
if (options.label) {
newChart.on('label:click', e => {
action({
x: e.x,
y: e.y,
data: {
data: e.target.attrs.data
}
})
})
}
configPlotTooltipEvent(chart, newChart) configPlotTooltipEvent(chart, newChart)
return newChart return newChart
} }
@ -175,6 +186,7 @@ export class Radar extends G2PlotChartView<RadarOptions, G2Radar> {
group.addShape({ group.addShape({
type: 'text', type: 'text',
attrs: { attrs: {
data,
x: 0, x: 0,
y: 0, y: 0,
text: value, text: value,