antvis/G2

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Uncaught (in promise) TypeError: Cannot destructure property '__data__' of 'element.parentNode' as it is null #6452

mabo0001 posted onGitHub

问题描述

使用elementPointMove,不能移动第一个点 1 2

重现链接

No response

重现步骤

<script setup> import { onMounted, ref } from 'vue'; import { Chart } from '@antv/g2'; const c = ref(null) const data = [ { x: 11, y: 6715, }, { x: 12, y: 6069.88272, }, { x: 13, y: 4858.33165, }, { x: 14, y: 3833, }, { x: 15, y: 2399, }, { x: 16, y: 1613, }, { x: 17, y: 1132, }, { x: 18, y: 809.8, }, { x: 19, y: 579.4, }, { x: 20, y: 416.4, }, { x: 21, y: 302.4, }, { x: '22', y: 219.5, }, { x: 23, y: 152.9, }, ] onMounted(() => { const chart = new Chart({ container: c.value, autoFit: true, }); chart .line() .data(data) .interaction({elementPointMove: true }) .encode('x', 'x') .encode('y', 'y') chart.on('afterrender', () => { chart.emit('element-point:select', { data: { selection: [0], }, }); }); chart.render().then(() => { chart.on('element-point:select', (v) => { const { data: { selection }, } = v; console.log(selection, 'selection'); }); chart.on('element-point:moved', (v) => { const { data: { changeData, data }, } = v; console.log(changeData, 'changeData'); console.log(data, 'data'); }); }); }) </script>

<template> <div id="container" ref="c" style="width:800px; height:500px"></div> </template>

<style scoped></style>

预期行为

我期望 能正常移动第一个点不会报错

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests