antvis/G2

Do you want to work on this issue?

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

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

FangYuru posted onGitHub

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) }) `

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 / 其他

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

Image

posted by FangYuru 2 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests