Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mabo0001 opened this issue Sep 4, 2024 · 0 comments

Comments

@mabo0001
Copy link

mabo0001 commented Sep 4, 2024

问题描述

使用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>
<style scoped></style>

预期行为

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

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant