G2
G2 copied to clipboard
legend独显切换配合label的limit-in-plot有bug
- [ ] I have searched the issues of this repository and believe that this is not a duplicate.
Reproduction link
https://g2.antv.vision/zh/examples/interaction/component#legend-active
Steps to reproduce
import { Chart } from '@antv/g2';
// 默认已经加载 legend-active 交互 const data = [ { company: 'Apple', type: '整体', value: 1 }, { company: 'Facebook', type: '整体', value: 35 }, { company: 'Google', type: '整体', value: 28 }, { company: 'Apple', type: '非技术岗', value: 1 }, { company: 'Facebook', type: '非技术岗', value: 65 }, { company: 'Google', type: '非技术岗', value: 47 }, { company: 'Apple', type: '技术岗', value: 1 }, { company: 'Facebook', type: '技术岗', value: 18 }, { company: 'Google', type: '技术岗', value: 20 }, { company: 'Apple', type: '技术岗', value: 1 }, { company: 'Facebook', type: '技术岗', value: 30 }, { company: 'Google', type: '技术岗', value: 25 } ];
const chart = new Chart({ container: 'container', autoFit: true, limitInPlot: true, height: 500, });
chart.data(data);
chart.scale('value', { nice: true });
chart.legend({ position: 'top', radio: { style: { width: 12 } } });
chart .interval() .position('type*value').color('company') .adjust([{ type: 'dodge', marginRatio: 0 }]) .label('value', { layout: [ { type: 'interval-hide-overlap' }, { type: 'adjust-color' }, { type: 'limit-in-plot' }, ] });
chart.render();

| Environment | Info |
|---|---|
| g2 | 4.1.46 |
| System | - |
| Browser | - |
可以描述下 bug 是什么吗?