antvis/G2

The issue has been closed
brushXFilter 在有空 label 的时候展示 tooltip 有误 #4930
pearmini posted onGitHub
- 版本:5.0.4
- 复现:brush 之后 tooltip 失效
- 出现原因:和 label 有关,应该和这个 issue 是相同的问题:https://github.com/antvis/G2/issues/4757
import { Chart } from '@antv/g2';
const chart = new Chart({
container: 'container',
theme: 'classic',
width: 900,
height: 1000,
paddingRight: 80,
});
chart.coordinate({ transform: [{ type: 'transpose' }] });
chart
.interval()
.data({
type: 'fetch',
value: 'https://assets.antv.antgroup.com/g2/world-history.json',
})
.transform({ type: 'sortX', by: 'y' })
.transform({ type: 'sortColor', by: 'y', reducer: 'min' })
.axis('x', false)
.encode('x', 'civilization')
.encode('y', ['start', 'end'])
.encode('color', 'region')
.scale('color', { palette: 'set2' })
.label({ text: '' }) // 和这行代码有关系
chart.interaction('brushXFilter');
chart.render();