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] 对称条形图:当数据yField为字符串数组时,且将大的数值放入第一位,渲染后视图不正确,且图例 #3776

Open
zhenggaowei opened this issue May 14, 2024 · 0 comments
Labels
Bug Something isn't working

Comments

@zhenggaowei
Copy link

import { BidirectionalBar } from '@antv/g2plot';

export const data = [
{ country: '乌拉圭', '2018': 13.4, '2017': 12.3 },
{ country: '巴拉圭', '2018': 14.4, '2017': 6.3 },
{ country: '南非', '2018': 18.4, '2017': 8.3 },
{ country: '巴基斯坦', '2018': 34.4, '2017': 13.8 },
{ country: '阿根廷', '2018': 44.4, '2017': 19.5 },
{ country: '巴西', '2018': 24.4, '2017': 18.8 },
{ country: '加拿大', '2018': 54.4, '2017': 24.7 },
{ country: '中国', '2018': 104.4, '2017': 5.3 },
{ country: '美国', '2018': 165.2, '2017': 72.9 },
];

const BidirectionalBarPlot = new BidirectionalBar('container', {
data,
xField: 'country',
xAxis: {
position: 'bottom',
},
appendPadding: [0, 30],
interactions: [{ type: 'active-region' }],
yField: ['2018', '2017'],
tooltip: {
shared: true,
showMarkers: false,
},
// 开启 label 展示
label: {
// 默认居中, 'middle'
position: 'right',
// 默认为: 2
// offset: 4,
},
});

BidirectionalBarPlot.render();

bug
@zhenggaowei zhenggaowei added the Bug Something isn't working label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant