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

[Bug]: 在slider交互后,进行brushHighlight交互,获取到的selection为未进行slider交互前的selection #6604

Open
3 of 10 tasks
FangYuru opened this issue Feb 13, 2025 · 1 comment
Labels
waiting for maintainer Triage or intervention needed from a maintainer

Comments

@FangYuru
Copy link

FangYuru commented Feb 13, 2025

Describe the bug / 问题描述

`
import { Chart } from '@antv/g2';

const chart = new Chart({
container: 'container',
height: 640,
});

chart
.cell()
.data({
type: 'fetch',
value:
'https://gw.alipayobjects.com/os/bmw-prod/bd287f2c-3e2b-4d0a-8428-6a85211dce33.json',
})
.scale('color', { type: 'ordinal' })
.encode('x', 'x')
.encode('y', 'y')
.encode('color', 'index')
.style('stroke', '#000')
.style('inset', 2)
.animate('enter', { type: 'fadeIn' })
.slider('y')
.slider('x')
.interaction('brushHighlight', true)

chart.render();

chart.on('brush:end', (event) => {
const [colList, rowList] = event.data.selection
console.log(colList, rowList, event.data.selection, event)
})
`

Reproduction link / 复现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

先进行slider交互后在进行brushHighlight交互,监听brush:end事件,获得的data里的selection不正确。

Image

Version / 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@FangYuru FangYuru added the waiting for maintainer Triage or intervention needed from a maintainer label Feb 13, 2025
@FangYuru
Copy link
Author

我的目标是获取到选中的图例,目前是这样解决的

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for maintainer Triage or intervention needed from a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant