legend独显切换配合label的limit-in-plot有bug #3871
zailushang5011 posted onGitHub
- 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(); <img width="656" alt="截屏2022-04-14 上午11 01 36" src="https://user-images.githubusercontent.com/57588659/163305792-d178bbe7-14c9-471f-9fa2-8ec52fca6a08.png"> <img width="667" alt="截屏2022-04-14 上午11 02 02" src="https://user-images.githubusercontent.com/57588659/163305802-b124cce9-0f3b-407a-aede-78b8225c2b0e.png"> <img width="648" alt="截屏2022-04-14 上午11 03 02" src="https://user-images.githubusercontent.com/57588659/163305807-2cbca91a-d285-46ba-9aed-b92c89f9ee79.png">
Environment | Info |
---|---|
g2 | 4.1.46 |
System | - |
Browser | - |
<!-- generated by antv-issue-helper. DO NOT REMOVE -->